Ok, try this in a new blank document (add code to ThisDocument
class). Save it, close it, and re-open it and it will automatically add
a dropdown with 10 items, already dropped menu.
HTHVB Code:
Private Sub Document_Open() Call LoadMe End Sub Sub LoadMe() Dim oFF As FormField Dim i As Integer If ActiveDocument.FormFields.Count = 0 Then ActiveDocument.FormFields.Add ActiveDocument.Range(Start:=0, End:=0), wdFieldFormDropDown End If Set oFF = ActiveDocument.FormFields(1) oFF.DropDown.ListEntries.Clear For i = 1 To 10 oFF.DropDown.ListEntries.Add "Test " & i, i Next ActiveDocument.Protect wdAllowOnlyFormFields SendKeys "%{DOWN}", True 'oFF.DropDown.Value = 8 'Select the 8th element in the dropdown list. End Sub





Reply With Quote