-
Graham,
I am not trying to be critical and mentioning this only because I have had my head in XML entirely too much recently. Your whole function can be replaced with:
ActiveDocument.CustomXMLParts(3).SelectSingleNode("//ns0:PublishDate[1]").Text
Paul,
Excel has basically the same parts as Word:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oXMLPart As CustomXMLPart
Dim oNode As CustomXMLNode
MsgBox ActiveWorkbook.CustomXMLParts.Count
For Each oXMLPart In ActiveWorkbook.CustomXMLParts
For Each oNode In oXMLPart.DocumentElement.ChildNodes
Debug.Print oNode.BaseName & " " & oNode.Text
Next oNode
Next oXMLPart
lbl_Exit:
Exit Sub
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules