#1
|
|||
|
|||
Populate Pulldown list with Macro
I have about 40 names to add to a pulldown list (content controls, ActiveX) in a word document. This happens regularly enough that I would really appreciate a macro that will do this for me.
Previously I had a macro that would do this for me.. Before I would paste the names in a word document, separated with carriage return, I would run the macro from a documents and it would populate the pulldown list with the names in the document.. Unfortunately, I have exhausted my search abilities and cannot find that macro (having switched computers, I have lost all my previous macros..). |
#2
|
|||
|
|||
Content controls and ActiveX controls lists can be populated using an array. The following code populates the a selected cc dropdown list:
Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey Dim arrItems() As String Dim lngIndex As Long arrItems = Split("Item1|Item2|Item3", "|") For lngIndex = 0 To UBound(arrItems) Selection.Range.ContentControls(1).DropdownListEntries.Add arrItems(lngIndex), arrItems(lngIndex) Next lngIndex End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MSWord forms use list to populate successive text fields | 2surgeons | Word | 4 | 03-05-2012 07:19 PM |
Macro to List out all the Sub folders | Ram1989 | Excel Programming | 0 | 02-27-2012 12:33 AM |
Populate dropdown list with data from Access table | spw4000 | Office | 0 | 02-24-2012 05:22 AM |
Macro to populate a text form field based on dropdown selection | koloa | Word | 0 | 10-20-2011 11:52 AM |
Reset "Move to Folder" Pulldown | RichieRich | Outlook | 0 | 10-09-2010 07:02 AM |