The following sample code retrieves the MIME stream and displays it in the immediate window. You can write additional code to parse the data and retrieve specific information. The exception information is not available through WebDAV as a simple property.
To use the sample code, follow these steps:
- In Microsoft Visual Basic, create a new Standard EXE project.
- Add a button to the default form and name it Command1.
- Paste the following code into the view code window:
Private Sub Command1_Click()
'Reference MS XMl 2.0 library to try the following sample code.
Dim strMime as String
Dim strURL as String
'Change the strURL below to reflect your recurring appointment.
strURL=<http://exchangeservername/exchange/user1/calendar/myappt.eml>"
Set xmlReq = CreateObject("Microsoft.xmlhttp")
'Change the domain name\userID and password to reflect your environment.
xmlReq.Open "GET", strURL, False, "domainname\userid", "password"
xmlReq.setRequestHeader "Translate", "f"
xmlReq.setRequestHeader "Content-Type", "text/xml"
xmlReq.Send
strMime = xmlReq.ResponseText
Debug.Print strMime
'Display the results.
If (xmlReq.Status >= 200 And xmlReq.Status < 300) Then
Debug.Print "Success! " & "Results = " & xmlReq.Status & ": " & xmlReq.statusText
Debug.Print xmlReq.ResponseText
Else
Debug.Print "Request Failed. Results = " & xmlReq.Status & ": " & xmlReq.statusText
End If
End Sub