Document Dropdowns Reference

G

Guest

How do I refer to a document dropdown without using its name. Like in
Excel I use Sheet1.DropDowns(dropdown_name). How can I do that in
Word? It's not a form fied so it does not work when I do FormFields. I
would like to have a loop for the dropdowns in my document.
 
M

macropod

Hi,

In Word, DropDowns are formfields! Each DropDown's name is that of the bookmark it sets, which you can see if the document is
unprotected and you right-click on the field to expose its properties. You can test them in code. For example:

Sub DropDownTest()
Dim oFld As FormField
With ActiveDocument
For Each oFld In .FormFields
If oFld.Type = wdFieldFormDropDown Then
If oFld.Name = "DropDown2" then MsgBox "Found it!"
End If
Next
End With
End Sub

Cheers

--
macropod
[MVP - Microsoft Word]


| How do I refer to a document dropdown without using its name. Like in
| Excel I use Sheet1.DropDowns(dropdown_name). How can I do that in
| Word? It's not a form fied so it does not work when I do FormFields. I
| would like to have a loop for the dropdowns in my document.
|
 

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