View Single Post
 
Old 12-13-2018, 03:03 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

While it takes a bit more work, in cases involving combobox or dropdown list, you can leverage the ContentControlBeforeStoreUpdate event. It provides a pseudo change event. To make it work, you have title and map the content controls.




Code:
Private Sub Document_ContentControlBeforeStoreUpdate(ByVal ContentControl As ContentControl, Content As String)
Dim oNode As CustomXMLNode
Dim lngIndex As Long
  If ContentControl.Tag = "Master" Then
    Select Case Content
      Case 1, 2, 3
         For lngIndex = 1 To 5
          Set oNode = ContentControl.XMLMapping.CustomXMLPart.SelectSingleNode(Replace(ContentControl.XMLMapping.XPath, "Master", "Slave" & lngIndex))
          oNode.Text = "Gender " & Content & " output " & lngIndex & " text"
        Next lngIndex
      Case Else
        For lngIndex = 1 To 5
          Set oNode = ContentControl.XMLMapping.CustomXMLPart.SelectSingleNode(Replace(ContentControl.XMLMapping.XPath, "Master", "Slave" & lngIndex))
          oNode.Text = ChrW(8203)
        Next lngIndex
      End Select
  End If
lbl_Exit:
  Exit Sub
End Sub
Attached Files
File Type: docm change text.docm (58.4 KB, 26 views)
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/

Last edited by gmaxey; 12-14-2018 at 07:28 AM.
Reply With Quote