#1   Report Post  
Brw
 
Posts: n/a
Default 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   Report Post  
Greg Maxey
 
Posts: n/a
Default

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   Report Post  
Graham Mayor
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Statement parameter in Mailmerge.OpenDataSource Christof Nordiek Mailmerge 6 April 26th 05 09:31 AM
Possible BUG: Multiple HTTPrequests send from one includetext statement Oliver Mailmerge 2 April 18th 05 09:46 AM
Multiple If... Then Statement in Word 2003 Sue Hargrave Mailmerge 1 February 26th 05 10:48 PM
How do I copy a scanned signature into an if/or statement in Word mcgowan Mailmerge 2 February 1st 05 06:37 AM
Insert carriage return in mergefield statement dixie Mailmerge 2 December 22nd 04 03:42 AM


All times are GMT +1. The time now is 09:31 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"