Home |
Search |
Today's Posts |
#1
|
|||
|
|||
If Then statement
I have a pulldown field with two options the user can choose from.
I want a seperate sentence to say something specific based on option 1 from the pulldown and another sentence to say something else baded on option 2. Could someone give me direction on how to do this in Word if it even does this? Can I expand this to allow 2 options? I know how to do this in Excel, but not familiar with vba and coding. |
#2
|
|||
|
|||
Brw,
You could set an on exit macro to run from your drop down fiedl to set the value of a text field. Something like this may work: Sub OnExit() Dim oDoc As Document Dim mySelection As String Set oDoc = ActiveDocument mySelection = oDoc.FormFields("DropDown1").Result Select Case mySelection Case Is = "A" oDoc.FormFields("Text1").Result = "Some sentence text" Case "B" oDoc.FormFields("Text1").Result = "Some other sentence text" Case Else MsgBox "All cells are in use." End Select End Sub "A" and "B" are values in the dropdown field. You can expand to 2 options by simply adding more Case statements. -- Greg Maxey/Word MVP See: http://gregmaxey.mvps.org/word_tips.htm For some helpful tips using Word. Brw wrote: I have a pulldown field with two options the user can choose from. I want a seperate sentence to say something specific based on option 1 from the pulldown and another sentence to say something else baded on option 2. Could someone give me direction on how to do this in Word if it even does this? Can I expand this to allow 2 options? I know how to do this in Excel, but not familiar with vba and coding. |
#3
|
|||
|
|||
See http://www.gmayor.com/SelectFile.htm
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Brw wrote: I have a pulldown field with two options the user can choose from. I want a seperate sentence to say something specific based on option 1 from the pulldown and another sentence to say something else baded on option 2. Could someone give me direction on how to do this in Word if it even does this? Can I expand this to allow 2 options? I know how to do this in Excel, but not familiar with vba and coding. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Statement parameter in Mailmerge.OpenDataSource | Mailmerge | |||
Possible BUG: Multiple HTTPrequests send from one includetext statement | Mailmerge | |||
Multiple If... Then Statement in Word 2003 | Mailmerge | |||
How do I copy a scanned signature into an if/or statement in Word | Mailmerge | |||
Insert carriage return in mergefield statement | Mailmerge |