I am trying to open the root folder on Exchange 2007 using MAPI. If I use the following... HrMAPIOpenFolderEx(lpMailbox, '\\', szStoreFolderPath, &lpRootFolder) I can open the @PR_IPM_INBOX_ENTRYID but when I try and open @PR_IPM_SUBTREE_ENTRYID it fails. This works with Exchange 5.5 thru 2003. Did they change the name of the root folder? How do I access the root folder for Exchange 2007 (on a client with MAPI support). If I look at it in OutlookSpy it still says IPM_SUBTREE for the display name property on the root folder. Thanks, David
David wrote in news:2bt9p3p6bjgfr1rlbn796rp4me8s8ds4a3@4ax.com: > I am trying to open the root folder on Exchange 2007 using MAPI. If I > use the following... > > HrMAPIOpenFolderEx(lpMailbox, '\\', szStoreFolderPath, &lpRootFolder) HrMAPIOpenFolderEx is part of the EDK, which is bad: http://blogs.msdn.com/jasonjoh/archive/2004/08/01/204585.aspx I'd guess there's a bug in there somewhere. You have a couple of choices: 1. get the EDK source and trace through it to work out what's going on 2. just write code yourself to read PR_IPM_SUBTREE_ENTRYID and openentry on that (or use the source code from MFCMAPI as a newer place to get sample code from -- that navigates down to top-of-info-store by opening the entryid above. If MFCMAPI doesn't work, then something strange is going on). -- dan
Dan, Thanks for the suggestion. I started to play with the EDK source and for the heck of it used the string "Top of Information Store" instead of the @PR_IPM_SUBTREE_ENTRYID and it worked. Not sure if it will cause me grief in other languages. On Mon, 21 Jan 2008 13:06:37 -0800, Dan Mitchell wrote: >David wrote in >news:2bt9p3p6bjgfr1rlbn796rp4me8s8ds4a3@4ax.com: >> I am trying to open the root folder on Exchange 2007 using MAPI. If I >> use the following... >> >> HrMAPIOpenFolderEx(lpMailbox, '\\', szStoreFolderPath, &lpRootFolder) > > HrMAPIOpenFolderEx is part of the EDK, which is bad: > >http://blogs.msdn.com/jasonjoh/archive/2004/08/01/204585.aspx > > I'd guess there's a bug in there somewhere. You have a couple of choices: > > 1. get the EDK source and trace through it to work out what's going on > 2. just write code yourself to read PR_IPM_SUBTREE_ENTRYID and openentry >on that > > (or use the source code from MFCMAPI as a newer place to get sample code >from -- that navigates down to top-of-info-store by opening the entryid >above. If MFCMAPI doesn't work, then something strange is going on). > > -- dan