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