View Single Post
 
Old 07-16-2019, 12:37 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Not sure what you are trying to do but as far as the Client Contact CC you do have, then something like this:



Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oTbl As Table
Dim i As Long
Dim StrDetails() As String
With ContentControl
  If .Title = "Client Contact" Then
    Set oTbl = ContentControl.Range.Tables(1)
    If Not ContentControl.ShowingPlaceholderText Then
      For i = 1 To .DropdownListEntries.Count
        If .DropdownListEntries(i).Text = .Range.Text Then
          StrDetails = Split(.DropdownListEntries(i).Value, "|")
          oTbl.Cell(3, 4).Range.Text = StrDetails(0)
          oTbl.Cell(4, 4).Range.Text = StrDetails(1)
          Exit For
        End If
      Next
    Else
      oTbl.Cell(3, 4).Range.Text = vbNullString
      oTbl.Cell(4, 4).Range.Text = vbNullString
    End If
  End If
End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote