Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2014, 08:31 AM
Samedy Samedy is offline Populate Pulldown list with Macro Windows 7 64bit Populate Pulldown list with Macro Office 2007
Novice
Populate Pulldown list with Macro
 
Join Date: Feb 2014
Posts: 1
Samedy is on a distinguished road
Default 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..).
Reply With Quote
  #2  
Old 02-25-2014, 06:59 PM
gmaxey gmaxey is offline Populate Pulldown list with Macro Windows 7 32bit Populate Pulldown list with Macro Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Pulldown list with Macro 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft