![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Guess,
I didn't see the tree for the forest. Thanks. I've modified a bit as Attempt5 because with your Attempt4, an error would occur if the CC just created is not the first indexed in the selection paragraph. Code:
Sub Attempt5()
Dim oRng As Range
Dim oCC As ContentControl
Set oRng = Selection.Range
Application.CommandBars.ExecuteMso ("ContentControlDropDownList")
oRng.End = oRng.End + 2
Set oCC = oRng.ContentControls(1)
With oCC
.DropdownListEntries.Add "A", "Apples"
.DropdownListEntries.Add "B", "Beets"
'Result: A fully functional DDL content control.
End With
lbl_Exit:
Exit Sub
End Sub
|
|
|
|
Similar Threads
|
||||
| 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 |
Pass combobox content to header
|
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 |