From: johnnykunst on
I'm trying to create a macro to be used 'on exit' from a drop down where the user selects their work scheme, and the drop down for the employees is populated from bookmarked text entries depending on what scheme they selct. The text is just that, text which has been bookmarked.
'namedd' is the drop down to be populated, 'callsigndd' is the drop down where they first select their work scheme; the bookmarks Camberwell1 through to Camberwell16 are the bookmarks from which I want the entries in the 'namedd' to be populated. It doesn't work though and gives an error message that the object does not exist, even though it does (the drop downs). So far I have the following:


Sub populatename()
ActiveDocument.FormFields("nameDD").DropDown.ListEntries.Clear
Select Case ActiveDocument.FormFields("callsigndd").Result


Case "C (Camberwell)"
Selection.FormFields("nameDD").DropDown.ListEntries.Clear
Selection.FormFields("namedd").DropDown.ListEntries.Add Name:= _
ActiveDocument.Bookmarks("Camberwell1").Range.Text


Selection.FormFields("nameDD").DropDown.ListEntries.Add Name:= _
ActiveDocument.Bookmarks("Camberwell2").Range.Text

Selection.FormFields("nameDD").DropDown.ListEntries.Add Name:= _
ActiveDocument.Bookmarks("Camberwell3").Range.Text

Selection.FormFields("nameDD").DropDown.ListEntries.Add Name:= _
ActiveDocument.Bookmarks("Camberwell4").Range.Text

Selection.FormFields("nameDD").DropDown.ListEntries.Add Name:= _
ActiveDocument.Bookmarks("Camberwell5").Range.Text

Selection.FormFields("nameDD").DropDown.ListEntries.Add Name:= _
ActiveDocument.Bookmarks("Camberwell6").Range.Text


End Select
End Sub

---
frmsrcurl: http://msgroups.net/microsoft.public.vb.general.discussion