A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook add-in: How to find localized name of the "Junk e-mail"folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 13th 09, 01:34 PM 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

Hi,
I am writing an C++COM add-in that will add improved spam filtering. I
have a toolbar with a "Mark as spam" button for this purpose. How do I
find out what is the name of the folder that acts as Junk e-mail
folder. I presume that the actual name and path to this folder can
differ based on the office localization and/or user language settings
and/or account settings ... It might as well be that no such folder
exists and it needs to be created (i.e. in pre-Office 2003 versions)

Please help.

Many thanks
Ads
  #2  
Old May 13th 09, 02:30 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook add-in: How to find localized name of the "Junk e-mail" folder

NameSpace.GetDefaultFolder(OlDefaultFolders.olFold erJunk) will work for any
Outlook version that has a Junk folder. That's language independent.

--
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
...
Hi,
I am writing an C++COM add-in that will add improved spam filtering. I
have a toolbar with a "Mark as spam" button for this purpose. How do I
find out what is the name of the folder that acts as Junk e-mail
folder. I presume that the actual name and path to this folder can
differ based on the office localization and/or user language settings
and/or account settings ... It might as well be that no such folder
exists and it needs to be created (i.e. in pre-Office 2003 versions)

Please help.

Many thanks


  #3  
Old May 13th 09, 03:33 PM 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

Many thanks, mate!
  #4  
Old May 14th 09, 01:42 PM 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

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?
  #5  
Old May 14th 09, 07:35 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook add-in: How to find localized name of the "Junk e-mail" folder

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?


  #6  
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)
  #7  
Old May 15th 09, 02:04 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook add-in: How to find localized name of the "Junk e-mail" folder

What do you mean by where it came from? Do you mean the sender? Nothing
changes with that.

If a spam comes in and gets directed to the Junk folder it obviously was
originally delivered to the Inbox, that's the only folder where the Junk
filter is active and the only place where incoming emails are delivered.

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

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)

  #8  
Old May 18th 09, 08:03 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 15 kvě, 15:04, "Ken Slovak - [MVP - Outlook]"
wrote:
What do you mean by where it came from? Do you mean the sender? Nothing
changes with that.

If a spam comes in and gets directed to the Junk folder it obviously was
originally delivered to the Inbox, that's the only folder where the Junk
filter is active and the only place where incoming emails are delivered.

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

...
snip

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)


What I meant is that I many people sort their incoming mail into
different folders based on some sort of a logic (say Inbox, Family,
Friends, Client1, Client2, ...) and when such message get marked as
spam by mistake then my "Not Spam" button handler can only move it
back into the Inbox (thus not placing it in the correct inbox context
folder (ie. Family)). Or am I getting it wrong and anything that lands
inside Inbox gets filtered based on the filtering rules anyway?
  #9  
Old May 18th 09, 02:55 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook add-in: How to find localized name of the "Junk e-mail" folder

Anything that gets added to Inbox will fire the junk filter and any rules
you have set up. If something is classified as spam you normally whitelist
it and/or the sender, then you move it where you want if the rules don't do
it, or you manually run the rules.

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

What I meant is that I many people sort their incoming mail into
different folders based on some sort of a logic (say Inbox, Family,
Friends, Client1, Client2, ...) and when such message get marked as
spam by mistake then my "Not Spam" button handler can only move it
back into the Inbox (thus not placing it in the correct inbox context
folder (ie. Family)). Or am I getting it wrong and anything that lands
inside Inbox gets filtered based on the filtering rules anyway?

  #10  
Old May 26th 09, 04:13 PM 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

Will it be possible to call

Store.GetSpecialFolder(olFolderJunk) to retrieve a junk folder for
every store instead of retrieving the generic one via
Session.GetDefaultFolder(olFolderJunk) ? And in a similar way marking
stuff as not spam would then move the item to Store.GetSpecialFolder
(olFolderInbox)

Does it make any sense?
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Empty "Junk E-mail" Folder on the shortcut menu GRAYED OUT TERRY Outlook - General Queries 6 October 30th 07 02:08 AM
Spam with Exchange junk e-mail setting doesnt goto the "junk e-mail" folder in all cases/people.. 2007/2003 outlook markm75 Outlook - General Queries 3 October 12th 07 05:48 PM
Spam with Exchange junk e-mail setting doesnt goto the "junk e-mail" folder in all cases/people.. 2007/2003 outlook markm75 Outlook - General Queries 0 October 11th 07 10:27 PM
Empty "Junk E-Mail" folder on menu bar Rick in NS Outlook - Installation 0 June 8th 07 06:16 PM
How to unblock items sent to "Junk Email" folder in Outlook Expres Novice Mom Outlook - Using Contacts 2 May 1st 07 03:40 PM


All times are GMT +1. The time now is 02:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.