View Single Post
 
Old 01-11-2021, 12:19 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
or take a look at Insert Content Control Add-In
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote