View Single Post
 
Old 09-20-2017, 03:14 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit 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

Using the original example from: https://www.msofficeforums.com/word-...own-lists.html
you might add separate content controls named 'Phone', 'Fax' & 'Email', then use code like:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long
With ContentControl
  If .Title = "Client" Then
    For i = 1 To .DropdownListEntries.Count
      If .DropdownListEntries(i).Text = .Range.Text Then
        ActiveDocument.SelectContentControlsByTitle("Phone")(1).Range.Text = Split(.DropdownListEntries(i).Value, "|")(0)
        ActiveDocument.SelectContentControlsByTitle("Fax")(1).Range.Text = Split(.DropdownListEntries(i).Value, "|")(1)
        ActiveDocument.SelectContentControlsByTitle("Email")(1).Range.Text = Split(.DropdownListEntries(i).Value, "|")(2)
        Exit For
      End If
    Next
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote