Outlook 2003 add in - public folder question.

Outlook 2003 add in - public folder question.

Post by aegi » Fri, 08 Jul 2005 16:50:22


Hi All,

Doing some work with outlook 2003 and attempting to browse over the
folders available to the user. I want to start at the top of their
public folders and will eventually drill down.

NameSpace outlookNS = applicationObject.GetNamespace("MAPI");
MAPIFolder topFolder =
outlookNS.GetDefaultFolder(OlDefaultFolders.olPublicFoldersAllPublicFolders)
;

I call the above 2 lines of code, and get an exception "The operation
failed. An object could not be found" over the second line. The code
works fine if I change the value of olPublicFoldersAllPublicFolders to
say something like olFoldersInbox.

Anyone have any ideas why this may be so? All samples I've seen on the
net seem to indicate I'm coding it correctly..