Message 1 of 4
Reading XML data

Not applicable
01-25-2006
07:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I hope someone can help jump-start me in reading data from ADT XML files. I
would like to simply obtain certain information from the .apj (project data
folders) so I can use it in VBA. I can get the XML document open, but have
no idea what to do after that.
I have MSXML reference in my project and have gotten as far as opening the
XML document, but then have no idea how to get any particular piece of data
out of it. I'm trying to figure it out from books and MS online docs, but
they're telling me way more than I need to know.
Here's what I've got so far:
Option Explicit
Public Sub testxml()
Dim filnam As String
filnam = tl_get_adt_project
tl_xml_getval filnam
End Sub
''This gets the name of the ADT project file for the current active project
from the registry
Public Function tl_get_adt_project() As String
Dim key As RegKey
Dim keystr, keystr1 As String
keystr = "\HKEY_CURRENT_USER\software\Autodesk\autocad\" & _
"R16.2\ACAD-4004:409\recent Project list"
Set key = Registry.RegKeyFromString(keystr)
keystr1 = key.Values("Project1")
tl_get_adt_project = keystr1
End Function
' This opens the file and
Public Sub tl_xml_getval(xmfile As String) As String
Dim msdom As DOMDocument
Dim xx As IXMLDOMNodeList
Dim itm As IXMLDOMNode
Set msdom = CreateObject("MSXML.DOMDocument")
msdom.Load (xmfile)
msdom.async = False
''At this point, I have no idea what to do
Set msdom = Nothing
End Sub
would like to simply obtain certain information from the .apj (project data
folders) so I can use it in VBA. I can get the XML document open, but have
no idea what to do after that.
I have MSXML reference in my project and have gotten as far as opening the
XML document, but then have no idea how to get any particular piece of data
out of it. I'm trying to figure it out from books and MS online docs, but
they're telling me way more than I need to know.
Here's what I've got so far:
Option Explicit
Public Sub testxml()
Dim filnam As String
filnam = tl_get_adt_project
tl_xml_getval filnam
End Sub
''This gets the name of the ADT project file for the current active project
from the registry
Public Function tl_get_adt_project() As String
Dim key As RegKey
Dim keystr, keystr1 As String
keystr = "\HKEY_CURRENT_USER\software\Autodesk\autocad\" & _
"R16.2\ACAD-4004:409\recent Project list"
Set key = Registry.RegKeyFromString(keystr)
keystr1 = key.Values("Project1")
tl_get_adt_project = keystr1
End Function
' This opens the file and
Public Sub tl_xml_getval(xmfile As String) As String
Dim msdom As DOMDocument
Dim xx As IXMLDOMNodeList
Dim itm As IXMLDOMNode
Set msdom = CreateObject("MSXML.DOMDocument")
msdom.Load (xmfile)
msdom.async = False
''At this point, I have no idea what to do
Set msdom = Nothing
End Sub