View Single Post
 
Old 01-11-2021, 08:38 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Paul, Graham


Graham appears to be correct. It seems my habit of using vbNullString in code has bitten me here. Revising my earlier Attempt2:

Code:
Sub Attempt5()
Dim oCC As ContentControl
  Set oCC = ActiveDocument.ContentControls.Add(wdContentControlDropdownList, Selection.Range)
  With oCC.DropdownListEntries
    .Add oCC.PlaceholderText, ""  'Using vbNullString in this Attempt2 seems to have been the problem.
    .Add "A", "Apples"
    .Add "B", "Beets"
  End With
lbl_Exit:
  Exit Sub
End Sub
Appears to work as well.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote