![]() |
|
|
Thread Tools | Display Modes |
#3
|
||||
|
||||
![]()
What you need is
Code:
Sub Macro1() Dim oCC As ContentControl Set oCC = ActiveDocument.ContentControls.Add(wdContentControlDropdownList, Selection.Range) With oCC .Title = "My List Box" .Tag = .Title .LockContentControl = False .SetPlaceholderText , , "Select Fruit" .DropdownListEntries.Add Text:=.PlaceholderText, value:="" .DropdownListEntries.Add Text:="Apples", value:="Apples" .DropdownListEntries.Add Text:="Pears", value:="Pears" .DropdownListEntries.Add Text:="Plums", value:="Plums" .DropdownListEntries.Add Text:="Grapes", value:="Grapes" End With Set oCC = Nothing End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to save docx to doc that checks compatibility and converts content controls to static content. | staicumihai | Word VBA | 4 | 10-12-2016 08:23 PM |
![]() |
wpryan | Word VBA | 3 | 07-17-2015 01:44 AM |
VBA ppt ComboBox behaivor: 1.OnFocus change value 2. get dropdownlist doesn't disappear after mousec | janism22 | PowerPoint | 2 | 03-26-2015 12:35 AM |
Create UserForm ComboBox or ContentControl | ptmuldoon | Word VBA | 11 | 01-17-2015 05:58 PM |
How to use the content of a combobox for {IF} field? | Melaanie | Word | 0 | 06-14-2010 02:00 AM |