The following code snippet loads an XML file from the current directory into an XML DOM object. In Visual Basic, the current directory is represented by App.Path
property.
Visual Basic Source File (LoadXMLFile.frm)
Private Sub Form_Load() Dim doc As New DOMDocument50 doc.async = False doc.validateOnParse = False doc.resolveExternals = False Path = App.Path + "\test.xml" doc.Load Path MsgBox "doc: " + doc.xml End Sub
To add LoadXMLFile.frm to the project
Next, we'll add the resource file, test.xml.