View Single Post
 
Old 11-19-2020, 02:20 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

There is a lot of good stuff in that page but it has been a long time since I've looked at it. In many instances, the built-in events can be used as pseudo change events. In your case, I would add a customXMLPart



<?xml version="1.0"?>
<CC_Map_Root xmlns="http://TheAnchorage.com">
<Service></Service>
<oCC_Linked_1></oCC_Linked_1>
<oCC_Linked_2></oCC_Linked_2>
<oCC_Linked_3></oCC_Linked_3>
<oCC_Linked_4></oCC_Linked_4>
</CC_Map_Root>



Map your CCs to the respective node then use:


Code:
Private Sub Document_ContentControlBeforeContentUpdate(ByVal ContentControl As ContentControl, Content As String)
  Select Case ContentControl.Title
    Case "Service"
      With ContentControl
        If .XMLMapping.CustomXMLNode.SelectSingleNode("/ns0:CC_Map_Root[1]/ns0:Service").Text = "Civilian" Then 'E.g., if the selected entry = "Civilian" and the fifth LE = "Civilian" then
          .XMLMapping.CustomXMLNode.SelectSingleNode("/ns0:CC_Map_Root[1]/ns0:oCC_Linked_1[1]").Text = "N/A"
          .XMLMapping.CustomXMLNode.SelectSingleNode("/ns0:CC_Map_Root[1]/ns0:oCC_Linked_2[1]").Text = "N/A"
          .XMLMapping.CustomXMLNode.SelectSingleNode("/ns0:CC_Map_Root[1]/ns0:oCC_Linked_3[1]").Text = "N/A"
          .XMLMapping.CustomXMLNode.SelectSingleNode("/ns0:CC_Map_Root[1]/ns0:oCC_Linked_4[1]").Text = "N/A"
        End If
      End With
  End Select
lbl_Exit:
  Exit Sub
End Sub

In the ThisDocument module
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote