View Single Post
  #2  
Old May 26th 09, 04:12 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to judge what folder the specified entry id is?

GetDefaultFolder will only work with certain folders in your default mail
store (where emails are delivered). I'm not familiar at all with the Outlook
connector, but if it shows folders in Outlook it most likely is mimicking a
PST file. In that case you can iterate the Stores collection in Outlook 2007
or NameSpace.Folders in earlier versions to get all opened stores. From
there you can get folders and each folder is a MAPIFolder, where you can
check on the DefaultItemType property to see what type of folder it is.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"ryotyankou via OfficeKB.com" u48591@uwe wrote in message
news:96a564faae503@uwe...
I scaned all message store to search folders and add them to a tree with
checkbox. user can select what folder to do deal with, i want to set
different icon to the tree item. I have icon for inbox, outbox, sent items
and so on. So i want to know what kind of MAPIFolder is, for the default
message store, it is esay to know this while use GetDefaultFolder, for
other
message store like hotmail, i tried a way, it worked fine, but when i add
hotmail account via outlook connector(from microsoft), it not work any
more.
My method is:
1. use NameSpace::GetDefaultFolder get the folder.
2. Get name of the default folder and save it to a map.
3. do 1,2 to get other folder string, inbox, outbox(...etc.)
4. for no default message store, check their name if existed in the map,
if
does, return id will show which kind it is.
Hotmail(via outlook connector) is not work, because some string are
english,
such inbox, sent items, some are local language, such as chinese string of
"outbox".
Any ideas? If i want to check the folder's(MAPIFolder) type?

--
Message posted via http://www.officekb.com


Ads