I downloaded the Microsoft office 2003 Web services toolkit and I'm trying to learn it better so I can automate some things with our SharePoint site. I am just using the example code from the help file that came with the toolkit but I get an error message. "It is an error to mix objects from different version of MSXML." I am new to xml so this might be an easy fix. Here is the code.
Sub GetListCollection()
' Class created by toolkit to connect to the Web service
Dim ws As New clsws_Lists
' The collection is returned as an XML node list
Dim lc As MSXML2.IXMLDOMNodeList
'Root node of the returned list
Dim nod As MSXML2.IXMLDOMNode
' Document to hold an XSLT transform
Dim docXSLT As New MSXML2.DOMDocument60
' Output string for the XML transformation
Dim strOutput As String
' Retrieve the collection of lists
Set lc = ws.wsm_GetListCollection
' Create the XSLT to select the desired information
docXSLT.LoadXml ("<xsl:stylesheet" & _
"xmlns:xsl=""http://www.w3.org/1999/XSL/Transform""" & _
" xmlns:wss=""http://schemas.microsoft.com/sharepoint/soap/""" & _
" version=""1.0""><xsl:output method=""text"" />" & _
"<xsl:template match=""wss:List"">," & _
"<xsl:value-of select=""@Title""/>," & _
"<xsl:value-of select=""@ID""/></xsl:template></xsl:stylesheet>")
' Get the root node from the list
Set nod = lc.Item(0)
' Apply the XSLT transform
'****next line of code throws the error
strOutput = (nod.transformNode(docXSLT))
' Use the Word 2003 object model to turn the results into a table
With Selection
.TypeText ("List Name, List ID" & strOutput)
.HomeKey wdStory, wdExtend
.ConvertToTable Separator:=wdSeparateByCommas, NumColumns:=2
.HomeKey wdStory
End With
End Sub
Bookmarks