How to get the result from a DropDown box

T

TheGrimbler

I am writing a form letter than gives the reader the chance to make a
selection for different questions. I am using the Forms toolbar to place a
Drop-Down Form Field in the letter. I use the Form Field Option box to
define the items in the drop-down list. The Bookmark is identified as
Dropdown1. Then I Protect the document. When I run the following macro, it
gives me the content of the Text Form Fields but for the Drop-Down Form
Fields it shows only a box.

Sub Macro1()
Dim Content As String
Dim info As String
Dim ShowIt as String
For i = 1 To 26
ActiveDocument.Bookmarks(i).Select
info = Selection
Content = "Item # " & i & " =" & info
ShowIt = MsgBox(Content)
Next i
End Sub

Any ideas as to know whether the Dropdown box was clicked on Yes, No, Maybe?

Thanks
 
D

Doug Robbins - Word MVP

Use

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name


--
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
 
T

TheGrimbler

Mr. Robbins' solution worked like a charm. I had to add a Dimension
statement defining myDrop as an Object. And then presto! He's a genius in
my book. Thanks a whole bunch.

TheGrimbler
 

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