Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

Drop Down Lists

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sue - 03 Jan 2005 19:25 GMT
I am new to VBA.  I have a document that is 27 pages long and has approximately 150 drop down fields.  The drop down fields will all contain the drop down items.  Instead of manually entering the 4 values to each drop down field, how do I set up a macro that will autopopulate all of the drop down boxes with the same information.

Thanks !
S~
Greg - 03 Jan 2005 20:16 GMT
Sue,

Maybe something like:

Sub ScratchMacro1()

Dim fField As FormField

For Each fField In ActiveDocument.FormFields
If fField.Type = wdFieldFormDropDown Then
With fField.DropDown.ListEntries
.Add Name:="Blue"
.Add Name:="Green"
.Add Name:="Red"
.Add Name:="Yellow"
   End With
  End If
Next
End Sub
Sue - 04 Jan 2005 16:50 GMT
Greg -

Thanks for the code.  It worked perfectly.

S~
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.