Quote:
Originally Posted by Guessed
The source lists can be coded into the vba but then the client is going to be confused even more if they need to edit the vba. You could also embed the lists in a custom xml file but there is no real benefit in terms of making it easy for the client to update the list.
IMO the slickest way would be to set up the first instance of each CB as the 'master' and allow the user to manually update that instance and then have the macro copy that list to the other related instances.
So use the Title property of each CC to link the series. And use the Tag property to define the CC which contains the master list for that series. Then use the following macro to copy the list from each 'Master' to the other CCs which share its Title property.
Code:
Sub UpdateCCList()
Dim aCCMaster As ContentControl, aCC As ContentControl, i As Integer, sTitle As String
For Each aCCMaster In ActiveDocument.SelectContentControlsByTag("Master")
sTitle = aCCMaster.Title
For Each aCC In ActiveDocument.SelectContentControlsByTitle(sTitle)
If aCC.Tag <> "Master" Then
aCC.DropdownListEntries.Clear
For i = 1 To aCCMaster.DropdownListEntries.Count
aCC.DropdownListEntries.Add aCCMaster.DropdownListEntries(i).Text
Next i
End If
Next aCC
Next aCCMaster
End Sub
|
Hi Andrew,
Thank you so much.
It works like a charm and I think it will be easier for the client to understand and as it is embedded in the document, I love it!
Really appreciate it!
Cheers