View Single Post
 
Old 10-12-2022, 03:07 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Paul,


This is a very long thread. Perhaps I've shared this with you before but not sure. Have you considered mapping the two controls in your example file (post #2). If you do, your code is reduced to:


Code:
Private Sub Document_ContentControlBeforeContentUpdate(ByVal ContentControl As ContentControl, Content As String)
  With ContentControl
    If .Title = "Client" Then
      .XMLMapping.CustomXMLPart.SelectSingleNode("/ns0:CC_Map_Root[1]/ns0:ClientDetails[1]").Text = _
        Replace(.XMLMapping.CustomXMLPart.SelectSingleNode("/ns0:CC_Map_Root[1]/ns0:Client[1]").Text, "|", vbCr)
    End If
  End With
lbl_Exit:
  Exit Sub
End Sub

with no requirement to exit the Client CC
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote