View Single Post
 
Old 06-26-2018, 04:23 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use code like:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
  If .Title = "Client" Then
    If .LockContents = True Then Exit Sub
    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
    With ActiveDocument.ContentControls(2)
      If .LockContents = True Then Exit Sub
      .Range.Text = StrDetails
      .LockContents = True
    End With
    .LockContents = True
  End If
End With
End Sub
Do note that this will prevent anyone changing their selection & output unless both content controls are unlocked.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote