c# - MAPI Property to get Inbox Folder in Outlook 2007 -


I have this routine to get specific folders from Outlook folders:

  / / Property SentFolder string propertyName = "tag of http://schemas.microsoft.com/mapi/proptag/0x35E40102"; Outlook. Folder Folders = Store. Gatoroot folder () Folder; Object entry = propertyAccesor.GetProperty (propertyName); DefaultFolderEntryID = Property Accessor. Binrostostring (entry); If (! String.IsNullOrEmpty (defaultFolderEntryID)) {foreach (Outlook.Folder defaultFolder in folders) {if (defaultFolder.EntryID == defaultFolderEntryID) {folder = defaultFolder; break; } Marshal. Release com object (default folder); }} Marshal. Release com objects (folders); Marshal.ReleaseComObject (store);   

I have properties tags of all the folders but Inbox, nobody knows what is the property tag in the Inbox folder? Or any other way to get Inbox folder without using the word "Inbox"

Currently, I use this routine to get the Inbox folder, but it depends on the Outlook language to work: Public Outlook Folder GetInboxFolder (Outlook.Store store) {Outlook.Folders folders = store.GetRootFolder (). Folder; Foreign exchange (Outlook.Folder f in folders) {if (f.Name.ToUpper (). This includes ("inbox") return f;} return tap;}

if English If the Outlook is in another language, then this routine is not working.

First of all, Inbox There is no such tag for - Multiple Inboxes can be like regular mail messages ( IPM. * ) go to the Inbox folder, but the root folder of the IPC. * message store Fear (Invisible to End User).

On extended MAPI level (C ++ or Delphi), you must call IMsgStore :: GetReceiveFolder or return to IMPSStore :: GetReceiveFolderTable MAPI table You can play with them (click the IMsgStore button).

If you are using Outlook 2010 or higher, you can use the .GetDefaultFolder (olFolderInbox) method .

If you are stuck with Outlook 2007, you can use it and The GetDefaultFolder (olFolderInbox) method (works in all versions of Outlook).

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -