View Single Post
 
Old 05-17-2014, 03:48 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

I suspect it's a reference to a technique I used here: https://www.msofficeforums.com/word-...own-lists.html, where the | has nothing to do with content control properties but with parsing some data stored in the content control value. Using the approach in that document, one might also use:
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
    For i = 1 To .DropdownListEntries.Count
      If .DropdownListEntries(i).Text = .Range.Text Then
        StrDetails = .DropdownListEntries(i).Value
        Exit For
      End If
    Next
    With ActiveDocument
      With .SelectContentControlsByTitle("Phone/Fax")(1).Range
        If StrDetails <> "" Then
          .Text = Split(StrDetails, "|")(0) & Chr(11) & Split(StrDetails, "|")(1)
        Else
          .Text = ""
        End If
      End With
      With .SelectContentControlsByTitle("Email")(1).Range
        If UBound(Split(StrDetails, "|")) > 0 Then
          .Text = Split(StrDetails, "|")(2)
        Else
          .Text = ""
        End If
      End With
    End With
  End If
End With
End Sub
where the phone & fax #s are output to a content control named Phone/Fax and the email address is output to a content control named Email.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote