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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Priority Property when creating Task Item in Exchange mailbox in WebDa

Status
Not open for further replies.

saadabc

Programmer
Aug 5, 2004
107
US
Does anyone know how to set the Priority Property for a Task when creating a New Task in Exchange mailbox using WebDav. Like what the hexadecimal code for that is.

Here's the code that I'm using - and so far here're the codes that I've found.




strXMLNSInfo = "xmlns:d=""DAV:"" " & _
"xmlns:e="" " & _
"xmlns:b=""urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"" " & _
"xmlns:f=""urn:schemas:mailheader:"" " & _
"xmlns:g=""urn:schemas:httpmail:"" " & _
"xmlns:h=""
' Set the Task item properties. The reminder time is set in seconds.
' To create an all-day meeting, set the dtstart/dtend range for 24 hours
' or more and set the alldayevent property to 1. See the documentation
' on the properties in the urn:schemas:calendar: namespace for more information.

'"<cal:dtstart dt:dt=""dateTime.tz"">2004-05-18T23:00:00.000Z</cal:dtstart>" & _
Start = Start.Replace("\", "-")
Start = Start.Replace("/", "-")



strTaskInfo = "<h:0x00008102 b:dt=""float"">.75</h:0x00008102>" & _
"<h:0x00008101 b:dt=""int"">0</h:0x00008101>" & _
"<h:0x00008104 b:dt=""dateTime.tz"">" & Start & "T13:30:00.00Z</h:0x00008104>" & _
"<h:0x00008105 b:dt=""dateTime.tz"">" & dtEnd & "T00:00:00Z</h:0x00008105>" & _
"<h:0x0000811C b:dt=""boolean"">0</h:0x0000811C>" & _
"<h:0x00008503 b:dt=""boolean"">1</h:0x00008503>"
'"<h:0x00008102 b:dt=""float"">0</h:0x00008102>" & _


'00008102 is percentage of the Task completed
'00008101 is Status - 0-4 Not Started-Completed
'00008104 is start date
'00008105 is end date
'0000811C is - Outlook task is done or not
'00008503 is
'00008113 is Task State
'x0810f Date Completed
'x08110 Actual Effort
'x08111 estimated effort
'x08518 Mode
'x0811f as Owner











Thanks.
 
Ok - I figured this out.
I just have to use:

"<e:x-priority-long b:dt=""int"">2</e:x-priority-long>"


Another question:

Has anyone used the WebDAV Delete method to delete calendar appointments and Outlook tasks. I'm using the following code to try and delete a calendar appointment but it is erroring out: the error message says "The remote server returned an error (501): Not Implemented.




' Variables.
Dim Request As System.Net.HttpWebRequest
Dim Response As System.Net.HttpWebResponse
Dim MyCredentialCache As System.Net.CredentialCache
Dim strPassword As String
Dim strDomain As String
Dim strUserName As String
Dim strSourceURI As String
Dim strmailbox As String
Dim exchServername As String

strmailbox = Environment.UserName
strmailbox = Right(strmailbox, Len(strmailbox) - InStr(strmailbox, "\"))

exchServername = "SACINF02"

Try
' Initialize variables.
strUserName = strmailbox
strPassword = thepassword
strDomain = "SACRAMENTO"
strSourceURI = " & exchServername & "/Calendar/" & strmailbox & "/" & TaskName & "Appt.eml"

' Create a new CredentialCache object and fill it with the network
' credentials required to access the server.
MyCredentialCache = New System.Net.CredentialCache
MyCredentialCache.Add(New System.Uri(strSourceURI), _
"NTLM", _
New System.Net.NetworkCredential(strUserName, strPassword, strDomain) _
)

' Create the HttpWebRequest object.
Request = CType(System.Net.WebRequest.Create(strSourceURI), _
System.Net.HttpWebRequest)

' Add the network credentials to the request.
Request.Credentials = MyCredentialCache

' Specify the method.
Request.Method = "DELETE"

' Send the DELETE method request and get the
' response from the server.
Response = CType(Request.GetResponse(), System.Net.HttpWebResponse)

MsgBox("Appointment successfully deleted.")

' Clean up.
Response.Close()

Catch ex As Exception

' Catch any exceptions. Any error codes from the
' DELETE method requests on the server will be caught
' here, also.
MsgBox(ex.Message)

End Try


How do I fix this error. I don't have direct control over the exchange server in our network - If We need to install anything - or add on to the existing Exchange server - i'm going to have to ask our network engineer - and probably also get authorization from the manager..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top