Forum Discussion
SuziieeWuziiee
Nov 01, 2022Copper Contributor
Content Control Drop Downs
Hello everyone,
I am in the middle of creating a drop-down menu. However, adding the values for this menu is genuinely time-consuming as I need to add a lot of them.
Is there any way at all, where I can bulk update this without adding the values one by one?
Appreciate any help.
Thank you!
1 Reply
SuziieeWuziiee You can use code such as the following in the Document_New event in the template from which you are creating the document with Content Controls
Private Sub Document_New() Dim CC As ContentControl Dim strList As String Dim varList As Variant strList = "Item1|Item2|Item3|Item4" varList = Split(strList, "|") For Each CC In ActiveDocument.ContentControls If CC.Title = "DropDown1" Then CC.DropdownListEntries.Clear For i = LBound(varList) To UBound(varList) CC.DropdownListEntries.Add varList(i) Next i End If Next CC End SubInstead of defining the list (strList) in the code, you can use a modification of any of the methods in the following article of Greg Maxey's website
http://gregmaxey.mvps.org/word_tip_pages/populate_userForm_listbox_or_combobox.html