Controls and Form Fields

A

Alan

I added a drop-down list to a document from the Developer tab by
inserting the control. However, when I run the code below, it does
not recognize it as a form field.

I must be missing something. . . . Please help. Alan

Sub CheckFormFields()
Dim aField As FormField
Debug.Print "There are " & ActiveDocument.FormFields.Count & _
" form fields in the active document"
For Each aField In ActiveDocument.FormFields
Debug.Print "Form Field Name: " & aField.Name
Debug.Print "Form Field Type: " & aField.Type
If aField.Type = wdFieldFormDropDown Then
Debug.Print "*** This is a drop-down list ***"
End If
Next aField
End Sub

Output: There are 0 form fields in the active document
 
J

Jay Freedman

See my reply in your other thread.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 

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