Find by string value : DOMDocument « XML « VBA / Excel / Access / Word

Find by string value

Sub FindNode()
           Dim oXmlDoc As DOMDocument
           Dim oXmlNode As IXMLDOMNode

           Set oXmlDoc = New DOMDocument
           oXmlDoc.async = False
           oXmlDoc.Load (ThisWorkbook.Path & "\EmployeeSales.xml")

           Set oXmlNode = oXmlDoc.SelectsingleNode ("//FirstName[text()='Mike']")
           Debug.Print oXmlNode.XML
End Sub


Related examples in the same category

1.Find by path
2.Find by value
3.Find and Edit the Node that Contains the FirstName Mike
4.Find and Delete all Nodes for the Employee Bullen