If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
WebDav - Outlook Contact Notes Field
am trying to insert a contact into outlook contact folder of a user using
WebDav API and VB.NET. I am following the sample code listed below. The problem that I am facing is updating notes pertaining to a contact. I have been trying c:notesTest Notes/c:notes and c:commentsTest Notesc:comments, but none of these seem to work. Do you happen to know the exact tag name that maps to notes filed of a contact in outlook. Dim strEmailInfo As String Dim strOrganizationalInfo As String Dim strPersonalInfo As String Dim strCustomerInfo As String Dim strFollowUpInfo As String Dim strMiscInfo As String Dim strUserFieldsInfo As String Dim objRequest As MSXML2.XMLHTTP Dim contactname As String = "Doe, John" Dim strnameinfo As String Dim strbusinessaddrinfo As String Dim strHomeAddrInfo As String Dim strOtherAddrInfo As String Dim strMailAddrInfo As String Dim strPhoneInfo As String Dim strBody As String Dim strXMLNSInfo As String Dim strURL As String Dim strResult As String = "Success" ' Dim myConnection As New SqlConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=FlexPoint_contacts;Data Source=exch01\bkupexec") 'Dim szSQL As String = " Select * From Flex_UsersContactList where ContactID=" & CInt(ContactID) 'Dim myDataAdapter As New SqlDataAdapter(szSQL, myConnection) 'Dim ds As New DataSet 'Dim myUserName As String 'myDataAdapter.Fill(ds) Dim myString As String = System.Configuration.ConfigurationSettings.AppSett ings("MailServer").ToString ' Specify the URL of the new object to be created. 'strURL = "http://ServerName/Exchange/UserName/Contacts/John Doe.eml" 'strURL = myString & "/speddi/Contacts/John Doe.eml" strURL = myString & "/pla/Contacts/John Doe.eml" ' Create an HTTP request object. 'objRequest = CreateObject("Microsoft.xmlhttp") objRequest = New MSXML2.XMLHTTP ' Specify the Namespaces to be used. strXMLNSInfo = "xmlns:g=""DAV:"" " & _ "xmlns:c=""urn:schemas:contacts:"" " & _ "xmlns:e=""http://schemas.microsoft.com/exchange/"" " & _ "xmlns:mapi=""http://schemas.microsoft.com/mapi/"" " & _ "xmlns:x=""xml:"" xmlns:cal=""urn:schemas:calendar:"" " & _ "xmlns:mail=""urn:schemas:httpmail:""" ' Specify the contact's name information. ' (First Name, Middle Name, Last Name, Full Name, ' Subject of the contact--used by Outlook Address Book, ' File As, Initials, Nickname, Title, and Suffix) strnameinfo = "c:givenNameJohn1234143/c:givenName" & _ "c:middlenameJacob/c:middlename" & _ "c:snDoe/c:sn" & _ "c:cnJohn J. Doe/c:cn" & _ "mail:subjectJohn Doe/mail:subject" & _ "c:fileasDoe, John/c:fileas" & _ "c:initialsJJD/c:initials" & _ "c:nicknameJohnnie/c:nickname" & _ "cersonaltitleMr./cersonaltitle" & _ "c:namesuffixMCSD/c:namesuffix" & _ "c:contactnoteTest/c:contactnote" & _ "e:contactnoteTest/e:contactnote" & _ "crncontactnoteTest/crncontactnote" ' Specify the Business Address Information. ' (Street, PO Box, City, State, Postal Code, and Country) strbusinessaddrinfo = "c:streetOne Microsoft Way/c:street" & _ "costofficeboxPO Box 12345/costofficebox" & _ "c:lRedmond/c:l" & _ "c:stWA/c:st" & _ "costalcode98052-6399/costalcode" & _ "c:coUSA/c:co" ' Specify the Home Address Information. ' (Street, PO Box, City, State, Postal Code, and Country) strHomeAddrInfo = "c:homeStreet500 Main Street/c:homeStreet" & _ "c:homepostofficeboxPO Box 54321/c:homepostofficebox" & _ "c:homeCityBellevue/c:homeCity" & _ "c:homeStateWA/c:homeState" & _ "c:homePostalCode98004/c:homePostalCode" & _ "c:homeCountryUSA/c:homeCountry" ' Specify the Other Address Information. ' (Street, PO Box, City, State, Postal Code, and Country) strOtherAddrInfo = "ctherstreet99 Myrtle Ave/ctherstreet" & _ "ctherpostofficeboxPO Box 98765/ctherpostofficebox" & _ "cthercityGreen Cove Springs/cthercity" & _ "ctherstateFL/ctherstate" & _ "ctherpostalcode32043/ctherpostalcode" & _ "cthercountryUSA/cthercountry" ' Specify which address is the mailing address. ' 0 = None, 1 = Home, 2 = Business, 3 = Other strMailAddrInfo = "c:mailingaddressid2/c:mailingaddressid" ' Specify phone number information. ' (Business Phone, Business Phone 2, Business Fax, ' Home Phone, Home Phone 2, Home Fax, ' Other Phone, Other Fax, Pager, Mobile Phone, ' Car Phone, ISDN, Telex, TTY/TDD, Callback) strPhoneInfo = "c:telephoneNumber425-555-1110/c:telephoneNumber" & _ "c:telephonenumber2425-555-1111/c:telephonenumber2" & _ "c:facsimiletelephonenumber425-555-1112/c:facsimiletelephonenumber" & _ "c:homePhone425-555-1113/c:homePhone" & _ "c:homephone2425-555-1114/c:homephone2" & _ "c:homefax425-555-1115/c:homefax" & _ "ctherTelephone904-555-1111/ctherTelephone" & _ "ctherfax904-555-1112/ctherfax" & _ "cager425-555-1116/cager" & _ "c:mobile425-555-1117/c:mobile" & _ "cthermobile904-555-1113/cthermobile" & _ "c:internationalisdnnumber425-555-1118/c:internationalisdnnumber" & _ "c:telexnumber425-555-1119/c:telexnumber" & _ "c:ttytddphone425-555-1120/c:ttytddphone" & _ "c:callbackphone425-555-1121/c:callbackphone" ' Specify the e-mail address information. strEmailInfo = "mapi:emaillisttype1/mapi:emaillisttype" & _ "mapi:email1addrtypeEX/mapi:email1addrtype" & _ "mapi:email1emailaddress" & _ "/o=Microsoft/ou=First Administrative Group/cn=Recipients/cn=jdoe" & _ "/mapi:email1emailaddress" & _ "mapi:email1originaldisplayname" & _ "John Doe (Exchange)" & _ "/mapi:email1originaldisplayname" & _ "mapi:email2addrtypeSMTP/mapi:email2addrtype" & _ "mapi:email2emailaddress" & _ " & _ "/mapi:email2emailaddress" & _ "mapi:email2originaldisplayname" & _ "John Doe (SMTP)" & _ "/mapi:email2originaldisplayname" & _ "mapi:email3addrtypeX400/mapi:email3addrtype" & _ "mapi:email3emailaddress" & _ "c=us;a= ;p=Microsoft;o=Exchange;s=Doe;g=John;i=J;" & _ "/mapi:email3emailaddress" & _ "mapi:email3originaldisplayname" & _ "John Doe (X400)" & _ "/mapi:email3originaldisplayname" ' Specify organizational information. ' (Company, Company Main Phone, Business Home Page, ' Department, Job Title, Manager's Name, ' Assistant's Name, Assistant's Phone, Office Location, ' Organizational ID Number, Computer Network Name, ' Profession) strOrganizationalInfo = "cMicrosoft Corporation/c" & _ "crganizationmainphone425-882-8080/crganizationmainphone" & _ "c:businesshomepagehttp://www.microsoft.com/c:businesshomepage" & _ "c:departmentYYY/c:department" & _ "c:titleLead Software Design Engineer/c:title" & _ "c:managerAshley Doe/c:manager" & _ "c:secretarycnPat Doe/c:secretarycn" & _ "c:secretaryphone425-555-1122/c:secretaryphone" & _ "c:roomnumberC-309/c:roomnumber" & _ "c:employeenumber987654321/c:employeenumber" & _ "c:computernetworknamejdoe/c:computernetworkname" & _ "crofessionSoftware Designer/crofession" ' Specify personal information. ' (Birthday, Anniversary, Spouse, Children, Gender, ' Personal Home Page, Hobbies) strPersonalInfo = "c:bday1974-01-01T08:00:00Z/c:bday" & _ "c:weddinganniversary1995-01-01T08:00:00Z/c:weddinganniversary" & _ "c:spousecnJane Doe/c:spousecn" & _ "c:childrensnames" & _ "x:vEllen Doe/x:vx:vGrace Doe/x:v" & _ "/c:childrensnames" & _ "c:genderMale/c:gender" & _ "cersonalHomePage" & _ "http://www.homepagedomain.com/JohnDoe/default.htm" & _ "/cersonalHomePage" & _ "c:hobbiesPlaying XBox games,Watching UltimateTV/c:hobbies" ' Specify customer related information. ' (Customer ID, Account, Billing Information) strCustomerInfo = "c:customeridYYY/c:customerid" & _ "c:accountYYY/c:account" & _ "c:billinginformationYYY/c:billinginformation" & _ "c:contactTest Comment/c:comment" ' Specify Follow Up/Reminder information. ' (Reminder, Reminder Topic, Reminder Time, etc.) strFollowUpInfo = "mapi:reminderset1/mapi:reminderset" & _ "mapi:requestCall/mapi:request" & _ "mapi:remindertime2001-12-01T08:00:00Z/mapi:remindertime" & _ "mapi:remindernexttime2001-12-01T08:00:00Z/mapi:remindernexttime" & _ "e:reply-by-iso2001-12-01T08:00:00Z/e:reply-by-iso" ' Specify miscellaneous information. ' (Categories, Contacts, Mileage, FTP Site, Language, ' Government ID, Location, Internet Free/Busy Address, ' Sensitivity) strMiscInfo = "e:keywords-utf8" & _ "x:vBuddies/x:vx:vEngineers/x:v" & _ "/e:keywords-utf8" & _ "mapi:contactsx:vPenelope Doe/x:v/mapi:contacts" & _ "e:mileageRarely used string property/e:mileage" & _ "c:ftpsiteftp://ftp.microsoft.com//c:ftpsite" & _ "c:languageUS English/c:language" & _ "c:governmentid000-00-0000/c:governmentid" & _ "c:locationNowhere Land/c:location" & _ "cal:fburlhttp://www.homepagedomain.com/JohnDoe/freebusy/cal:fburl" & _ "mapi:sensitivity2/mapi:sensitivity" ' Specify User Field information. ' (User Field 1, User Field 2, User Field 3, User Field 4) strUserFieldsInfo = "e:extensionattribute1User Data 1" & _ "/e:extensionattribute1" & _ "e:extensionattribute2User Data 2/e:extensionattribute2" & _ "e:extensionattribute3User Data 3/e:extensionattribute3" & _ "e:extensionattribute4User Data 4/e:extensionattribute4" ' Put it all together in an HTTP request. strBody = "?xml version=""1.0""?" & _ "gropertyupdate " & strXMLNSInfo & _ "g:set" & _ "grop" & _ "g:contentclassurn:content-classeserson/g:contentclass" & _ "eutlookmessageclassIPM.Contact/eutlookmessageclass" & _ strnameinfo & strbusinessaddrinfo & _ strHomeAddrInfo & strOtherAddrInfo & _ strMailAddrInfo & strPhoneInfo & _ strEmailInfo & strOrganizationalInfo & _ strPersonalInfo & strCustomerInfo & _ strFollowUpInfo & strMiscInfo & _ strUserFieldsInfo & _ "/grop" & _ "/g:set" & _ "/gropertyupdate" ' Open the request object, assigning it the method PROPPATCH ' objRequest.open("PROPPATCH", strURL, False, "UserName", "password") objRequest.open("PROPPATCH", "http://172.31.5.202/exchange/administrator/contacts/John Doe.eml", False, "devdemo.local\administrator", "p@$$w0rd") '"omni\administrator", "ic1ng0nthecak3?") ' Set the necessary headers for the request. objRequest.setRequestHeader("Content-Type", "text/xml") objRequest.setRequestHeader("Translate", "f") objRequest.setRequestHeader("Content-Length", Len(strBody)) ' Send the request, using the XML document as the body. Try objRequest.send(strBody) Catch ex1 As System.Runtime.InteropServices.COMException Return ex1.ToString Catch ex2 As COMException ex2.ToString() Catch ex As Exception Return ex.ToString Finally End Try 'Display the results. If (objRequest.status = 200 And objRequest.status 300) Then Return "Success! " & "Results = " & objRequest.status & _ ": " & objRequest.statusText ElseIf objRequest.status = 401 Then Return "You don't have permission to do the job! " & _ "Please check your permissions on this item." Else Return "Request Failed. Results = " & objRequest.status & _ ": " & objRequest.statusText End If objRequest = Nothing -- Message posted via http://www.officekb.com |
#2
|
|||
|
|||
The notes field in WebDAV syntax is "urn:schemas:httpmail:textdescription",
in the Outlook object model it's ContactItem.Body. A better place to post this would have been one of the Outlook or Exchange programming newsgroups. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Sumanth Peddi via OfficeKB.com" wrote in message ... am trying to insert a contact into outlook contact folder of a user using WebDav API and VB.NET. I am following the sample code listed below. The problem that I am facing is updating notes pertaining to a contact. I have been trying c:notesTest Notes/c:notes and c:commentsTest Notesc:comments, but none of these seem to work. Do you happen to know the exact tag name that maps to notes filed of a contact in outlook. Dim strEmailInfo As String Dim strOrganizationalInfo As String Dim strPersonalInfo As String Dim strCustomerInfo As String Dim strFollowUpInfo As String Dim strMiscInfo As String Dim strUserFieldsInfo As String Dim objRequest As MSXML2.XMLHTTP Dim contactname As String = "Doe, John" Dim strnameinfo As String Dim strbusinessaddrinfo As String Dim strHomeAddrInfo As String Dim strOtherAddrInfo As String Dim strMailAddrInfo As String Dim strPhoneInfo As String Dim strBody As String Dim strXMLNSInfo As String Dim strURL As String Dim strResult As String = "Success" ' Dim myConnection As New SqlConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=FlexPoint_contacts;Data Source=exch01\bkupexec") 'Dim szSQL As String = " Select * From Flex_UsersContactList where ContactID=" & CInt(ContactID) 'Dim myDataAdapter As New SqlDataAdapter(szSQL, myConnection) 'Dim ds As New DataSet 'Dim myUserName As String 'myDataAdapter.Fill(ds) Dim myString As String = System.Configuration.ConfigurationSettings.AppSett ings("MailServer").ToString ' Specify the URL of the new object to be created. 'strURL = "http://ServerName/Exchange/UserName/Contacts/John Doe.eml" 'strURL = myString & "/speddi/Contacts/John Doe.eml" strURL = myString & "/pla/Contacts/John Doe.eml" ' Create an HTTP request object. 'objRequest = CreateObject("Microsoft.xmlhttp") objRequest = New MSXML2.XMLHTTP ' Specify the Namespaces to be used. strXMLNSInfo = "xmlns:g=""DAV:"" " & _ "xmlns:c=""urn:schemas:contacts:"" " & _ "xmlns:e=""http://schemas.microsoft.com/exchange/"" " & _ "xmlns:mapi=""http://schemas.microsoft.com/mapi/"" " & _ "xmlns:x=""xml:"" xmlns:cal=""urn:schemas:calendar:"" " & _ "xmlns:mail=""urn:schemas:httpmail:""" ' Specify the contact's name information. ' (First Name, Middle Name, Last Name, Full Name, ' Subject of the contact--used by Outlook Address Book, ' File As, Initials, Nickname, Title, and Suffix) strnameinfo = "c:givenNameJohn1234143/c:givenName" & _ "c:middlenameJacob/c:middlename" & _ "c:snDoe/c:sn" & _ "c:cnJohn J. Doe/c:cn" & _ "mail:subjectJohn Doe/mail:subject" & _ "c:fileasDoe, John/c:fileas" & _ "c:initialsJJD/c:initials" & _ "c:nicknameJohnnie/c:nickname" & _ "cersonaltitleMr./cersonaltitle" & _ "c:namesuffixMCSD/c:namesuffix" & _ "c:contactnoteTest/c:contactnote" & _ "e:contactnoteTest/e:contactnote" & _ "crncontactnoteTest/crncontactnote" ' Specify the Business Address Information. ' (Street, PO Box, City, State, Postal Code, and Country) strbusinessaddrinfo = "c:streetOne Microsoft Way/c:street" & _ "costofficeboxPO Box 12345/costofficebox" & _ "c:lRedmond/c:l" & _ "c:stWA/c:st" & _ "costalcode98052-6399/costalcode" & _ "c:coUSA/c:co" ' Specify the Home Address Information. ' (Street, PO Box, City, State, Postal Code, and Country) strHomeAddrInfo = "c:homeStreet500 Main Street/c:homeStreet" & _ "c:homepostofficeboxPO Box 54321/c:homepostofficebox" & _ "c:homeCityBellevue/c:homeCity" & _ "c:homeStateWA/c:homeState" & _ "c:homePostalCode98004/c:homePostalCode" & _ "c:homeCountryUSA/c:homeCountry" ' Specify the Other Address Information. ' (Street, PO Box, City, State, Postal Code, and Country) strOtherAddrInfo = "ctherstreet99 Myrtle Ave/ctherstreet" & _ "ctherpostofficeboxPO Box 98765/ctherpostofficebox" & _ "cthercityGreen Cove Springs/cthercity" & _ "ctherstateFL/ctherstate" & _ "ctherpostalcode32043/ctherpostalcode" & _ "cthercountryUSA/cthercountry" ' Specify which address is the mailing address. ' 0 = None, 1 = Home, 2 = Business, 3 = Other strMailAddrInfo = "c:mailingaddressid2/c:mailingaddressid" ' Specify phone number information. ' (Business Phone, Business Phone 2, Business Fax, ' Home Phone, Home Phone 2, Home Fax, ' Other Phone, Other Fax, Pager, Mobile Phone, ' Car Phone, ISDN, Telex, TTY/TDD, Callback) strPhoneInfo = "c:telephoneNumber425-555-1110/c:telephoneNumber" & _ "c:telephonenumber2425-555-1111/c:telephonenumber2" & _ "c:facsimiletelephonenumber425-555-1112/c:facsimiletelephonenumber" & _ "c:homePhone425-555-1113/c:homePhone" & _ "c:homephone2425-555-1114/c:homephone2" & _ "c:homefax425-555-1115/c:homefax" & _ "ctherTelephone904-555-1111/ctherTelephone" & _ "ctherfax904-555-1112/ctherfax" & _ "cager425-555-1116/cager" & _ "c:mobile425-555-1117/c:mobile" & _ "cthermobile904-555-1113/cthermobile" & _ "c:internationalisdnnumber425-555-1118/c:internationalisdnnumber" & _ "c:telexnumber425-555-1119/c:telexnumber" & _ "c:ttytddphone425-555-1120/c:ttytddphone" & _ "c:callbackphone425-555-1121/c:callbackphone" ' Specify the e-mail address information. strEmailInfo = "mapi:emaillisttype1/mapi:emaillisttype" & _ "mapi:email1addrtypeEX/mapi:email1addrtype" & _ "mapi:email1emailaddress" & _ "/o=Microsoft/ou=First Administrative Group/cn=Recipients/cn=jdoe" & _ "/mapi:email1emailaddress" & _ "mapi:email1originaldisplayname" & _ "John Doe (Exchange)" & _ "/mapi:email1originaldisplayname" & _ "mapi:email2addrtypeSMTP/mapi:email2addrtype" & _ "mapi:email2emailaddress" & _ " & _ "/mapi:email2emailaddress" & _ "mapi:email2originaldisplayname" & _ "John Doe (SMTP)" & _ "/mapi:email2originaldisplayname" & _ "mapi:email3addrtypeX400/mapi:email3addrtype" & _ "mapi:email3emailaddress" & _ "c=us;a= ;p=Microsoft;o=Exchange;s=Doe;g=John;i=J;" & _ "/mapi:email3emailaddress" & _ "mapi:email3originaldisplayname" & _ "John Doe (X400)" & _ "/mapi:email3originaldisplayname" ' Specify organizational information. ' (Company, Company Main Phone, Business Home Page, ' Department, Job Title, Manager's Name, ' Assistant's Name, Assistant's Phone, Office Location, ' Organizational ID Number, Computer Network Name, ' Profession) strOrganizationalInfo = "cMicrosoft Corporation/c" & _ "crganizationmainphone425-882-8080/crganizationmainphone" & _ "c:businesshomepagehttp://www.microsoft.com/c:businesshomepage" & _ "c:departmentYYY/c:department" & _ "c:titleLead Software Design Engineer/c:title" & _ "c:managerAshley Doe/c:manager" & _ "c:secretarycnPat Doe/c:secretarycn" & _ "c:secretaryphone425-555-1122/c:secretaryphone" & _ "c:roomnumberC-309/c:roomnumber" & _ "c:employeenumber987654321/c:employeenumber" & _ "c:computernetworknamejdoe/c:computernetworkname" & _ "crofessionSoftware Designer/crofession" ' Specify personal information. ' (Birthday, Anniversary, Spouse, Children, Gender, ' Personal Home Page, Hobbies) strPersonalInfo = "c:bday1974-01-01T08:00:00Z/c:bday" & _ "c:weddinganniversary1995-01-01T08:00:00Z/c:weddinganniversary" & _ "c:spousecnJane Doe/c:spousecn" & _ "c:childrensnames" & _ "x:vEllen Doe/x:vx:vGrace Doe/x:v" & _ "/c:childrensnames" & _ "c:genderMale/c:gender" & _ "cersonalHomePage" & _ "http://www.homepagedomain.com/JohnDoe/default.htm" & _ "/cersonalHomePage" & _ "c:hobbiesPlaying XBox games,Watching UltimateTV/c:hobbies" ' Specify customer related information. ' (Customer ID, Account, Billing Information) strCustomerInfo = "c:customeridYYY/c:customerid" & _ "c:accountYYY/c:account" & _ "c:billinginformationYYY/c:billinginformation" & _ "c:contactTest Comment/c:comment" ' Specify Follow Up/Reminder information. ' (Reminder, Reminder Topic, Reminder Time, etc.) strFollowUpInfo = "mapi:reminderset1/mapi:reminderset" & _ "mapi:requestCall/mapi:request" & _ "mapi:remindertime2001-12-01T08:00:00Z/mapi:remindertime" & _ "mapi:remindernexttime2001-12-01T08:00:00Z/mapi:remindernexttime" & _ "e:reply-by-iso2001-12-01T08:00:00Z/e:reply-by-iso" ' Specify miscellaneous information. ' (Categories, Contacts, Mileage, FTP Site, Language, ' Government ID, Location, Internet Free/Busy Address, ' Sensitivity) strMiscInfo = "e:keywords-utf8" & _ "x:vBuddies/x:vx:vEngineers/x:v" & _ "/e:keywords-utf8" & _ "mapi:contactsx:vPenelope Doe/x:v/mapi:contacts" & _ "e:mileageRarely used string property/e:mileage" & _ "c:ftpsiteftp://ftp.microsoft.com//c:ftpsite" & _ "c:languageUS English/c:language" & _ "c:governmentid000-00-0000/c:governmentid" & _ "c:locationNowhere Land/c:location" & _ "cal:fburlhttp://www.homepagedomain.com/JohnDoe/freebusy/cal:fburl" & _ "mapi:sensitivity2/mapi:sensitivity" ' Specify User Field information. ' (User Field 1, User Field 2, User Field 3, User Field 4) strUserFieldsInfo = "e:extensionattribute1User Data 1" & _ "/e:extensionattribute1" & _ "e:extensionattribute2User Data 2/e:extensionattribute2" & _ "e:extensionattribute3User Data 3/e:extensionattribute3" & _ "e:extensionattribute4User Data 4/e:extensionattribute4" ' Put it all together in an HTTP request. strBody = "?xml version=""1.0""?" & _ "gropertyupdate " & strXMLNSInfo & _ "g:set" & _ "grop" & _ "g:contentclassurn:content-classeserson/g:contentclass" & _ "eutlookmessageclassIPM.Contact/eutlookmessageclass" & _ strnameinfo & strbusinessaddrinfo & _ strHomeAddrInfo & strOtherAddrInfo & _ strMailAddrInfo & strPhoneInfo & _ strEmailInfo & strOrganizationalInfo & _ strPersonalInfo & strCustomerInfo & _ strFollowUpInfo & strMiscInfo & _ strUserFieldsInfo & _ "/grop" & _ "/g:set" & _ "/gropertyupdate" ' Open the request object, assigning it the method PROPPATCH ' objRequest.open("PROPPATCH", strURL, False, "UserName", "password") objRequest.open("PROPPATCH", "http://172.31.5.202/exchange/administrator/contacts/John Doe.eml", False, "devdemo.local\administrator", "p@$$w0rd") '"omni\administrator", "ic1ng0nthecak3?") ' Set the necessary headers for the request. objRequest.setRequestHeader("Content-Type", "text/xml") objRequest.setRequestHeader("Translate", "f") objRequest.setRequestHeader("Content-Length", Len(strBody)) ' Send the request, using the XML document as the body. Try objRequest.send(strBody) Catch ex1 As System.Runtime.InteropServices.COMException Return ex1.ToString Catch ex2 As COMException ex2.ToString() Catch ex As Exception Return ex.ToString Finally End Try 'Display the results. If (objRequest.status = 200 And objRequest.status 300) Then Return "Success! " & "Results = " & objRequest.status & _ ": " & objRequest.statusText ElseIf objRequest.status = 401 Then Return "You don't have permission to do the job! " & _ "Please check your permissions on this item." Else Return "Request Failed. Results = " & objRequest.status & _ ": " & objRequest.statusText End If objRequest = Nothing -- Message posted via http://www.officekb.com |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Addresses - backup | Lewis Shanks | Setup, Installing & Configuration | 3 | June 3rd, 2005 05:41 PM |
How can I fix double line spacing in Outlook 2000 Contact notes fi | Tyger | Contacts | 0 | May 31st, 2005 03:24 PM |
Contact overall or Notes field size limit | Bill Hobson | Contacts | 0 | May 18th, 2005 09:21 PM |
Using Word 2000 Send To Mail Recipient with Outlook 2000 | carolpm | General Discussion | 12 | February 11th, 2005 04:03 AM |
Display WinXP Address Book in Last Name Order | Dennis Boone | Contacts | 13 | December 16th, 2004 12:23 AM |