View Single Post
  #5  
Old May 15th 09, 08:35 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 23
Default Outlook add-in: How to find localized name of the "Junk e-mail"folder

On 14 kvì, 20:35, "Ken Slovak - [MVP - Outlook]"
wrote:
If that's the case Outlook is totally confused. GetDefaultFolder() will
always and only retrieve folders from your default PST file or Exchange
mailbox. It cannot retrieve folders from other mail stores that aren't the
default.

NameSpace.Folders has all your loaded PST files. You can iterate that
collection and its subfolders, etc. to find any loaded folder. The pattern
looks like this:
NameSpace.Folders.Item(1).Folders.Item("Inbox").Fo lders.Item("myInboxSubfolder"),
etc.

--
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

wrote in message

...

Firstly thank you very much for your quick reply, I really appreciate
it! I found out that this solution is almost there but not quite...


In my environment I have these Outlook folders:
\Personal Folders\
\Personal Folders\Deleted Items
\Personal Folders\Drafts
\Personal Folders\Inbox
\Personal Folders\Junk E-mail
\Personal Folders\Sent Items
...
\Archive Folders
\
\Inbox


\Junk E-mail
...
The latter is my default data file or whatever it is called.
Now Session.GetDefaultFolder(olFolderJunk) points to \Private Folders
\Junk E-mail
but the REAL Junk E-mail folder (i.e. the one that Outlook uses for
this account) is \Junk E-mail


How do I find the path to that?


Thanks a lot. I have one more question regarding this:

Once a message is in a spam folder I guess there is no way to tell
where it came from? (in case I have implemented a more complex folder
logic instead of having just one Inbox folder)
Ads