That's the complete code I'm trying to use.
Option Explicit
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim lngIndex As Long
Dim lngCount As Long
Dim arrColors() As String
lngCount = ActiveDocument.ContentControls.Count
ReDim arrColors(1 To lngCount)
For lngIndex = 1 To ActiveDocument.ContentControls.Count
arrColors(lngIndex) = ActiveDocument.ContentControls(lngIndex).Range.Text
Next
FillBM "bmAccident", UBound(Filter(arrColors, "Accident Report")) + 1
FillBM "bmBalcony", UBound(Filter(arrColors, "Balcony")) + 1
FillBM "bmDoorLock", UBound(Filter(arrColors, "Door Lock")) + 1
FillBM "bmIncident", UBound(Filter(arrColors, "Incident Report")) + 1
FillBM "bmKeyFault", UBound(Filter(arrColors, "Key Fault")) + 1
FillBM "bmLostFoundLogged", UBound(Filter(arrColors, "L & F Logged")) + 1
FillBM "bmLostFoundReturned", UBound(Filter(arrColors, "L & F Returned")) + 1
FillBM "bmLockRead", UBound(Filter(arrColors, "Lock Read")) + 1
FillBM "bmSafe", UBound(Filter(arrColors, "Safe")) + 1
FillBM "bmTheft", UBound(Filter(arrColors, "Theft Allegation")) + 1
FillBM "bmEscort", UBound(Filter(arrColors, "Escort")) + 1
FillBM "bmIDCheck", UBound(Filter(arrColors, "ID Check")) + 1
lbl_Exit:
End Sub
Private Sub FillBM(strbmName As String, strValue As String)
Dim oRng As Range
With ActiveDocument
On Error GoTo lbl_Exit
Set oRng = .Bookmarks(strbmName).Range
oRng.Text = strValue
oRng.Bookmarks.Add strbmName
End With
lbl_Exit:
Set oRng = Nothing
Exit Sub
End Sub
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
Select Case .Title
Case Is = "Planner"
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
Exit For
End If
Next
ActiveDocument.SelectContentControlsByTag("Planner").Item(1).Range.Text = StrDetails
Case Else
End Select
End With
End Sub