' Local vars
Dim objRequest As MSXML2.XMLHTTP40
Dim strMailbox As String
Dim strXMLNSInfo As String
Dim strXMLRequest As String
' Derive the name of the actual mailbox to update
strMailbox = strOWAServer & "/exchange/" & strAlias & "/"
' XML namespace info of the WebDAV request.
strXMLNSInfo = "xmlns:g=""DAV:"" " & _
"xmlns:e=""http://schemas.microsoft.com/exchange/"" " &
_
"xmlns:mapi=""http://schemas.microsoft.com/mapi/"" " & _
"xmlns:mapit=""http://schemas.microsoft.com/mapi/proptag/"" " & _
"xmlns:dt=""urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"" " & _
"xmlns:x=""xml:"">"
' Build the XML body of the PROPPATCH request
strXMLRequest = "<?xml version=""1.0""?>" & _
"<g:propertyupdate " & strXMLNSInfo & _
"<g:set>" & _
"<g:prop>" & _
"<e:viewrowcount dt:dt=""long"">25</e:viewrowcount>" &
_
"<e:timezone>" & strTimeZone & "</e:timezone>" & _
"<e:spellingcheckbeforesend
dt:dt=""boolean"">1</e:spellingcheckbeforesend>" & _
"<e:spellingdictionarylanguage>en-us</e:spellingdictionarylanguage>" &
_
"</g:prop>" & _
"</g:set>" & _
"</g:propertyupdate>"
' Create the DAV PROPPATCH request.
Set objRequest = CreateObject("Microsoft.XMLHTTP")
objRequest.Open "PROPPATCH", strMailbox, False, strUser, strPswd
objRequest.setRequestHeader "Content-Type", "text/xml"
objRequest.setRequestHeader "Content-Length", Len(strXMLRequest)
objRequest.send strXMLRequest
' Check for errors in update
If (objRequest.Status >= 200 And objRequest.Status < 300) Then
MsgBox strAlias & " has been updated successfully."
Else
MsgBox "Error: " & objRequest.Status & " - " &
objRequest.statusText
End If
' Release object reference
Set objRequest = Nothing
Here is an copy of the XML generated:
<?xml version="1.0"?>
<g:propertyupdate xmlns:g="DAV:"
xmlns:e="http://schemas.microsoft.com/exchange/"
xmlns:mapi="http://schemas.microsoft.com/mapi/"
xmlns:mapit="http://schemas.microsoft.com/mapi/proptag/"
xmlns:dt="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
xmlns:x="xml:">
<g:set>
<g:prop>
<e:viewrowcount dt:dt="long">25</e:viewrowcount>
<e:timezone>Eastern Standard Time</e:timezone>
<e:spellingcheckbeforesend
dt:dt="boolean">1</e:spellingcheckbeforesend>
<e:spellingdictionarylanguage>en-us</e:spellingdictionarylanguage>
</g:prop>
</g:set>
</g:propertyupdate>
Any ideas why I would be getting the Bad Request error?
Thanks in advance
<e:viewrowcount dt:dt=""int"">25</e:viewrowcount>
all the valid datatype mappings for xml are listed here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_webstore_data_types.asp
Cheers
Glen
"Chcuk H" <pute...@bellsouth.net> wrote in message
news:1108590562....@f14g2000cwb.googlegroups.com...
Thanks again.