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

You can locate the junk folders for any store, but how they work is just as
normal folders in Outlook unless it's the junk folder for the default store.
That's the only one that will do the junk mail processing as items come in.
If you open a PST file as a secondary store that junk folder won't be
active.

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


Ads
  #12  
Old June 2nd 09, 03:43 PM posted to microsoft.public.outlook.program_addins
tnemec78@googlemail.com
external usenet poster
 
Posts: 23
Default Outlook add-in: How to find localized name of the "Junk e-mail"folder

OK I think I confused things a little bit. Now I am sure that I
finally found what I wanted to ask:

I found out that a store's Junk email can be identified as a 5th
element of the PR_ADDITIONAL_REN_ENTRYIDS IMAPIFolder property
Given a MailItem or a Folder instance how do I get that info? I assume
that I need to do something like this:

IUnknown *u;
folder-get_MAPIOBJECT(&u);
// will this give me the IMAPIFolder interface?
// How do I get the PR_ADDITIONAL_REN_ENTRYIDS property?
// How do I get the 5th element out of it?
// once I have it I can then do something like
namespace-GetFolderFromEntryID(entryID_received_from_steps_ above);

Could you please shed some light on this? I did not find any source
code that does this. C# or C++ does not matter just as long as there
is something.

Many thanks
  #13  
Old June 2nd 09, 04: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

I' not sure that's immutable and not dependent on the store provider, but
you get that PT_MV_BINARY property from the Inbox folder of a store using
the property tag 0x36D81102. Once you have that property it's just a array
of binary properties. So you get the 5th element of the array and then
convert that binary property into a hex string if you want.

--
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
...
OK I think I confused things a little bit. Now I am sure that I
finally found what I wanted to ask:

I found out that a store's Junk email can be identified as a 5th
element of the PR_ADDITIONAL_REN_ENTRYIDS IMAPIFolder property
Given a MailItem or a Folder instance how do I get that info? I assume
that I need to do something like this:

IUnknown *u;
folder-get_MAPIOBJECT(&u);
// will this give me the IMAPIFolder interface?
// How do I get the PR_ADDITIONAL_REN_ENTRYIDS property?
// How do I get the 5th element out of it?
// once I have it I can then do something like
namespace-GetFolderFromEntryID(entryID_received_from_steps_ above);

Could you please shed some light on this? I did not find any source
code that does this. C# or C++ does not matter just as long as there
is something.

Many thanks


  #14  
Old June 2nd 09, 04:42 PM posted to microsoft.public.outlook.program_addins
tnemec78@googlemail.com
external usenet poster
 
Posts: 23
Default Outlook add-in: How to find localized name of the "Junk e-mail"folder

I' not sure that's immutable and not dependent on the store provider, but
you get that PT_MV_BINARY property from the Inbox folder of a store using
the property tag 0x36D81102.


Can I find a source code anywhere that would show in detail how to do
this?
I don't know how to use property tag 0x36D81102 (I assume I do it
wrong)

void myfunction(CComPtr Outlook::_MailItem mi)
{
CComPtr IDispatch disp;
CComPtr MAPIFolder folder;
CComPtr IUnknown unk;
CComPtr IMAPIFolder ifolder;
SPropTagArray tags = {1, 0x36D81102/*PR_ADDITIONAL_REN_ENTRYIDS*/};
ULONG flags = 0, values;
LPSPropValue props;

mi-get_Parent(&disp);
disp-QueryInterface(__uuidof(MAPIFolder), (void **)&folder);
folder-get_MAPIOBJECT(&unk);
unk-QueryInterface(IID_IMAPIFolder, (void**)&ifolder);
ifolder-GetProps(&tags, flags, &values, &props);
...
at this point I think props should be filled with meaningfull data.
Debugger shows that props[0].Value.bin.cb == 6 but here the field props
[0].Value.bin.lb does not show anything similar to what OutlookSpy
shows :-(
  #15  
Old June 2nd 09, 04:46 PM posted to microsoft.public.outlook.program_addins
tnemec78@googlemail.com
external usenet poster
 
Posts: 23
Default Outlook add-in: How to find localized name of the "Junk e-mail"folder

Can I find a source code somewhere that shows how exatly do I get the
property with tag 0x36D81102 ???
I am probably doing something wrong. Here is what I do:

void myFunction(CComPtr Outlook::_MailItem mi)
{
CComPtr IDispatch disp;
CComPtr MAPIFolder folder;
CComPtr IUnknown unk;
CComPtr IMAPIFolder ifolder;
SPropTagArray tags = {1, 0x36D81102/*PR_ADDITIONAL_REN_ENTRYIDS*/};
ULONG flags = 0, values;
LPSPropValue props;

mi-get_Parent(&disp);
disp-QueryInterface(__uuidof(MAPIFolder), (void **)&folder);
folder-get_MAPIOBJECT(&unk);
unk-QueryInterface(IID_IMAPIFolder, (void**)&ifolder);
ifolder-GetProps(&tags, flags, &values, &props);
....
at this point props[0].Value.bin.cb == 6 according to the debugger but
props[0].Value.bin.lpb does not show anything similar to what
OutlookSpy reports :-(
  #16  
Old June 2nd 09, 07:00 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

Unless Dmitry answers this you should post Extended MAPI questions in
microsoft.public.win32.programmer.messaging, where the MAPI people hang out.

Most of the examples for things like this I know of are for the Outlook or
Redemption object models.

--
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
...
I' not sure that's immutable and not dependent on the store provider, but
you get that PT_MV_BINARY property from the Inbox folder of a store using
the property tag 0x36D81102.


Can I find a source code anywhere that would show in detail how to do
this?
I don't know how to use property tag 0x36D81102 (I assume I do it
wrong)

void myfunction(CComPtr Outlook::_MailItem mi)
{
CComPtr IDispatch disp;
CComPtr MAPIFolder folder;
CComPtr IUnknown unk;
CComPtr IMAPIFolder ifolder;
SPropTagArray tags = {1, 0x36D81102/*PR_ADDITIONAL_REN_ENTRYIDS*/};
ULONG flags = 0, values;
LPSPropValue props;

mi-get_Parent(&disp);
disp-QueryInterface(__uuidof(MAPIFolder), (void **)&folder);
folder-get_MAPIOBJECT(&unk);
unk-QueryInterface(IID_IMAPIFolder, (void**)&ifolder);
ifolder-GetProps(&tags, flags, &values, &props);
...
at this point I think props should be filled with meaningfull data.
Debugger shows that props[0].Value.bin.cb == 6 but here the field props
[0].Value.bin.lb does not show anything similar to what OutlookSpy
shows :-(


 




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:19 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.