There are two ways to instantiate an XML DOM object in Visual Basic. One way is to create the object at compile time, as follows:
Dim objXMLDoc As New DOMDocument50
You can also create the object at run time, as follows:
Dim objXMLDoc Set objXMLDoc = New DOMDocument50
In this demonstration we illustrate both ways of creating a XML DOM instance.
This tutorial uses or creates the following files:
File | Description |
---|---|
Source: InstantiateDOM.frm | Visual Basic source code. |
Output | Output from the application. |
To create the InstantiateDOM Visual Basic Project
Next, we'll add the source code for the InstantiateDOM project.