![]() |
|
#1
|
|||
|
|||
![]() Hello all. I currently have a form with drop down choices. There is one option that when chosen I would like to have it come up with a warning. Is this possible in Word. Newbee at adding VBA into Word docs. Thanks Pete |
#2
|
||||
|
||||
![]()
Yes, it's possible, but not without knowing: what type of dropdown; what the option is; or what the warning is.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Here is a screen shot of the form. It is just a basic combo box. They option that needs the warning is Litigation. Would like it to come up and say...
"Warning, if this is a litigation file then a Main Litigation file # must be provided!" |
#4
|
||||
|
||||
![]()
What's the name of the litigation content control and what is the name of the litigation file number content control?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
![]()
This what you need?
|
#6
|
||||
|
||||
![]()
That's fine for the litigation field - what about the number?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#7
|
|||
|
|||
![]()
How do I get the number?
Thanks Pete |
#8
|
|||
|
|||
![]()
There is no drop down for the litigation #. That will just be put in a text field below.
If that is what you mean? Thanks Pete |
#9
|
|||
|
|||
![]()
You can do it using the Content Control OnExit event:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Select Case ContentControl.Tag Case "type" If ContentControl.Range.Text = "Litigation / Litige" Then MsgBox "Some notification" End Select End Sub Code:
Private Sub Document_ContentControlBeforeStoreUpdate(ByVal ContentControl As ContentControl, Content As String) Select Case ContentControl.Tag Case "type" If ContentControl.Range.Text = "Litigation / Litige" Then MsgBox "Some notification" End Select End Sub |
#10
|
|||
|
|||
![]()
I opened the doc and went into Visual Basic. Put the code in and saved it as a macro file as it forced me too. Nothing happens though when selecting litigation.
Sorry very new at this . |
#11
|
|||
|
|||
![]()
Here is a snapshot
|
#12
|
|||
|
|||
![]()
Most likely because the text of the content control is litigation / litige and not Litigation / Litige as I erroneously put in the code.
|
#13
|
|||
|
|||
![]()
Yeah, that's the first thing I tried still didn't go.
Pete |
#14
|
|||
|
|||
![]()
Is the event firing? Is the procedure in the ThisDocument module of the project (it is a document event)? Is the CC tag "type"? Did you exit the control?
|
#15
|
|||
|
|||
![]()
Guessing it isn't firing as nothing happens when choosing litigation.
I did save and exit the control. Here are some snapshots. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jjmclell | Project | 3 | 03-20-2015 07:28 AM |
![]() |
freebee2 | Excel | 4 | 06-08-2014 11:21 PM |
![]() |
ajazz | Outlook | 5 | 06-11-2011 04:46 AM |
Problem with warning message | randynovotny | Outlook | 1 | 04-20-2011 04:56 PM |
Hyperlink Warning | gfkbob | Outlook | 0 | 01-23-2010 06:50 AM |