View Single Post
 
Old 01-10-2021, 04:35 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I think your clue of using the built-in UI provides an 'almost' acceptable method.
Code:
Sub Attempt4()
  Dim oCC As ContentControl
  Application.CommandBars.ExecuteMso ("ContentControlDropDownList")
  Set oCC = Selection.Range.Paragraphs(1).Range.ContentControls(1)  'this line is a weak attempt that could be more elegant
  With oCC
    .DropdownListEntries.Add "A", "Apples"
    .DropdownListEntries.Add "B", "Beets"
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia

Last edited by Guessed; 01-10-2021 at 04:39 PM. Reason: '
Reply With Quote