Email Body Changes based on value selected in Drop-Down List

G

GrPacker

I am trying to do something that seems rather simple, but I cannot get
it to work. To keep it simple, I just need to proper syntax of how to
return the value selected from a drop-down.

I have a Word FormField Drop-down box with list items already
created. A user will choose an option and then later I want to base
some actions on that option.

My List box's bookmark name is "Title"

Here is my sample code:

If Me.FormFields("Title").Result = "Staff" Then
MsgBox ("Staff")
End If
If Me.FormFields("Title").Result = "Manager" Then
MsgBox ("Manager")
End If

I dont think .Result is the right option. I have also
tried .DropDown.Value as well and that does not work. Please help
asap!

Nate
 
D

Doug Robbins - Word MVP

Assuming that what you have is a DropDown FormField as is used in a document
that is Protected for Filling in Forms, you cannot use the Me keyword in
that syntax. The following code will display in a message box the item that
is selected from a DropDown FormField to which the bookmark name of "Title"
has been assigned when the document containing that formfield is the active
document.

MsgBox ActiveDocument.FormFields("Title").result


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top