View Single Post
 
Old 03-18-2018, 03:02 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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

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
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote