Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Script to write ShapePoint list data collection to file. how to ?

Status
Not open for further replies.

Coyote2

MIS
May 25, 2010
41
US
Hi,
I have this script that writes the number of records of list collection to a text file but I'm not sure how I can write the values to the file. can you help?
thank you.
--------------------------
Option Explicit

Dim url
Dim list
Dim viewFields
Dim request
Dim xmlDoc
Dim elements
dim myFSO
dim writestuff

Set xmlDoc = CreateObject("MSXML2.DOMDocument.6.0")
xmlDoc.async = False

url = "list = "Action"
viewFields = "<viewFields><FieldRef Name='ows_ID'/></viewFields>"

request = "<?xml version='1.0' encoding='utf-8'?>" + _
"<soap:Envelope xmlns:xsi=' + _
" xmlns:xsd=' + _
" xmlns:soap=' + _
" <soap:Body>" + _
" <GetListItems xmlns=' + _
" <listName>" & list & "</listName>" + _
" <ViewFields>" & viewFields & "</ViewFields>" + _
" </GetListItems>" + _
" </soap:Body>" + _
"</soap:Envelope>"

'post it up and look at the response
with CreateObject("Microsoft.XMLHTTP")
.open "Get", url, False, null, null
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "SOAPAction"," .send request

xmlDoc.loadXML(.responseText)

Set elements = xmlDoc.getElementsByTagName("rs:data")
'wscript.echo "Number of items in list: " + elements(0).getAttribute("ItemCount")

Set myFSO = CreateObject("Scripting.FileSystemObject")
Set WriteStuff = myFSO.OpenTextFile("correct.txt", 8, True)
'WriteStuff.WriteLine(elements(0).getAttribute("ItemCount"))
WriteStuff.WriteLine(elements(0).getAttribute("value"))
WriteStuff.Close
SET WriteStuff = NOTHING
SET myFSO = NOTHING
end with
-------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top