Hi everyone. I'd like to import only certain XML elements from the InfoPath form into Access. I quite the newbie when it comes to InfoPath and XML...but here is what I have so far:
Sub TestXML()
Dim objDoc As MSXML2.DOMDocument40
Dim objNode As MSXML2.IXMLDOMNode
Dim nodeList As MSXML2.IXMLDOMNodeList
Set objDoc = New MSXML2.DOMDocument40
Set nodeList = objDoc.childNodes
objDoc.Load xmlSource:="C:\Documents and Settings\dmorri18\Desktop\Form1.xml"
For Each objNode In nodeList
' 1 = element and 7 = processing instruction
If objNode.nodeType = 1 Then
Debug.Print objNode.nodeTypedValue
End If
Next objNode
End Sub
The problem is it just prints the data in one long line. I'd like to only print out 3 of the 5 values. Does anyone know how to choose which ChildNodes I import?
Thanks,
Dave