Click to See Complete Forum and Search --> : VBScript help!!!


Funkymonkey
10-28-2005, 04:55 AM
I'm using webdav to get the subject of some e-mails but I need to display this info in xml. At the moment the results are sent straight to the xsl and are transfromed into html. Bear with me - I am getting to the point!

I need to display this xml.

Dim objXMLHTTP, objXMLDoc
' Define your protocol; http or https
strProtocol = "http"
' Define your server name
strServername = "mail"
' Define your local name for 'Inbox'
strInbox = "Inbox/IT"
Sub getMessages_OnClick()
strUsername = document.all.mailbox.value
If strUsername <> "" Then
strInboxURL = strProtocol & "://" & strServername & "/Exchange/"
strInboxURL = strInboxURL & strUsername & "/" & strInbox
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "SEARCH", strInboxURL, True
objXMLHTTP.setRequestHeader "Content-type:", "text/xml"
objXMLHTTP.setRequestHeader "Depth", "1"
objXMLHTTP.onReadyStateChange = getRef("checkXMLHTTPState")
strXML = "<?xml version='1.0' ?>" & _
"<a:searchrequest xmlns:a='DAV:'><a:sql>" & _
"SELECT" & _
" ""DAV:href""" & _
",""urn:schemas:httpmail:subject""" & _
",""urn:schemas:httpmail:from""" & _
" FROM scope('shallow traversal of """ & strInboxURL & """')" & _
" WHERE ""DAV:ishidden""=False" & _
" AND ""DAV:isfolder""=False" & _
"</a:sql></a:searchrequest>"
objXMLHTTP.SetRequestHeader "Range", "rows=0-50"
objXMLHTTP.Send(strXML)
End If
End Sub

Sub checkXMLHTTPState
If objXMLHTTP.readyState = 4 Then
responseStatus.innerHTML = objXMLHTTP.Status & " - " & objXMLHTTP.StatusText
Set objXMLDoc = objXMLHTTP.ResponseXML

XSLDiv.innerHTML = objXMLDoc.TransformNode(responseXSL.documentElement)
Set objXMLHTTP = Nothing
Set objXMLDoc = Nothing
End If
End Sub

I'm pretty sure it's objXMLDoc that I need to display.
Can anyone help???

Thanks loads!!!!!!!!!!!!!