View Single Post
 
Old 05-03-2024, 07:12 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Greg

I've had a big play with your code and wrestled with the same event not firing that you encountered. I tried a bunch of different things but couldn't figure out how to get the xml updates to stick without your document variable workaround.

The only thing I would suggest that you don't need three nodes to switch contents around. I would toggle the mapping of the CC rather than changing the customXML. You still need the nullnode but only need one contentnode if changing the mapping on the fly.
Code:
        If oNodePassed.Text = "true" Then
          aCC.XMLMapping.SetMapping XPath:="/ns0:CC_Map_Root[1]/ns0:ContentNode[1]", Source:=oCXMLPart
        Else
          aCC.XMLMapping.SetMapping XPath:="/ns0:CC_Map_Root[1]/ns0:NullNode[1]", Source:=oCXMLPart
        End If
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote