Summary
Using PR_URL_COMPNAME to bind to an item in WebDAV from CDO/MAPI involves understanding the encoding rules for the Exchange version where the item is homed. These rules are different and incompatiable between Exchange 2000, Exchange 2000 SP 1, and Exchange 2003. These rules are not documented and often require reverse engineering to properly encode URLs.Reading proptag 0x670E001E via MAPI on a folder or item will return a value such as…
/-FlatUrlSpace-/ca09cf9efaad754e8a85909b04bb255c-12ee443
...which can be appended to a URL and used to access and item or folder via WebDAV…
http://server/exchange/mailbox/-FlatUrlSpace-/ca09cf9efaad754e8a85909b04bb255c-12ee443
More Information
Flat URLs do not have encoding and escaping rules and will work for folders and items in most every DAV operation with the following exceptions:- as destination of MOVE or COPY operation- as a source for a DELETE- for OWA URL commands, e.g. "?cmd=[foo]"
...You are going to use this property in cases where you are stepping out of CDO 1.21 or MAPI code into WebDAV. The HREF in WebDAV is usually created from the subject that was typed in OL (messages created in OWA typically have a GUID file name). The subject in OL can contain characters that must be encoding for use with DAV similar to URL encoding. Rather than figure out those rules, you can use the Flat URL to get the item. The great thing about the proptag is that it is a direct link between MAPI and WebDAV...
...Enjoy...
...Don't know if many people try to use this anymore but it is worth noting...
SYMPTOM
Receive MAPI_E_FAILONEPROVIDER when attempting to log on anonymously to Exchange 200x using CDO 1.21.
...OR...
After anonymous log on to Exchange 200x using CDO 1.21, session object's AddressLists collection is empty.
CAUSE
In Exchange 200x there are several changes that affect using the anonymous log on method to gain access to Exchange:
"/cn=com/cn=domainname/cn=servername"
RESOLUTION
Change your code to use a temporary (dynamic) profile as illustrated in the following article.
195662 How to log on to Exchange with the ProfileInfo parameter
http://support.microsoft.com/default.aspx?scid=kb;EN-US;195662
ADDITIONAL INFO
When using temporary profiles in an ASP application the account which the ASP code is running in must have access to the Exchange account used in the profile.
Refer to the following article for information on using temporary profiles in an ASP application.
254567 PRB: CDO:"MAPI_E_NOT_FOUND" Error When You Call Session.Logon
http://support.microsoft.com/default.aspx?scid=kb;EN-US;254567
The Exchange Team has a great new post on the future of Public Folders in Exchange 12 and understanding how they are implemented. Be sure to read this post if you are thinking about moving to Exchange 12 and/or Outlook 2007, this article will provide you the facts for your public folder migration plans (or delay making plans all together).
...There are many custom applications that use Public Folders and while most will be supported there certain types of custom applications that require more than just the folder to work. For example, custom applications that use Exchange Workflow will have to be migrated for E12 because Workflow is not supported on E12...
...Also of note when planning your migration away from older Outlook clients is that they require public folders to work and that as long as you have pre Outlook 2007 clients connected to Exchange 12, you will need to have public folders enabled...
...The main focus of this article is to put your migration fears on hold, if not to rest, for Exchange 12 in that you will still have the Public Folder technology. Given that, the alternative technologies such as InfoPath, Sharepoint, and Windows Workflow Foundation are definitely worth looking into as they are exciting products and will be continue emphasized as a migration path for aging Exchange technologies...
Updated 1/22/2009 – Fixed a broken link.