View Single Post
 
Old 02-04-2016, 03:31 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Given that the second cell doesn't even have any content controls, I can only guess at what you want.

Suppose the dropdown content control in the 1st cell is titled 'ClientA' and the dropdown content control in the 2nd cell is titled 'ClientB'. Suppose also the text content control in the 1st cell is titled 'ClientDetailsA' and the text content control in the 2nd cell is titled 'ClientDetailsB'. In that case, you could use a macro like:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
Dim i As Long, StrDetails As String
With ContentControl
  If .Title = "ClientA" Then
    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.SelectContentControlsByTitle("ClientDetailsA")(1)
      .LockContents = False
      .Range.Text = StrDetails
      .LockContents = True
    End With
  ElseIf .Title = "ClientB" Then
    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.SelectContentControlsByTitle("ClientDetailsB")(1)
      .LockContents = False
      .Range.Text = StrDetails
      .LockContents = True
    End With
  End If
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote