Sub LearnAboutNodes()
Dim xmldoc As MSXML2.DOMDocument50
Dim xmlNode As MSXML2.IXMLDOMNode
Set xmldoc = New MSXML2.DOMDocument50
xmldoc.async = False
xmldoc.Load ("C:\yourFile.xml")
If xmldoc.hasChildNodes Then
Debug.Print "Number of child Nodes: " & xmldoc.childNodes.length
For Each xmlNode In xmldoc.childNodes
Debug.Print "Node name:" & xmlNode.nodeName
Debug.Print "Type:" & xmlNode.nodeTypeString & "(" & xmlNode.nodeType & ")"
Debug.Print "Text: " & xmlNode.Text
Next xmlNode
End If
Set xmlDoc = Nothing
End Sub
|