 |
|
|
|
| Author |
Message |
Tom at GSD
Joined: 14 Aug 2007 Posts: 7
|
Posted: Thu Oct 18, 2007 5:28 pm Post subject: Message Class and Folder assignment |
|
|
Hello,
I am trying to map a message class to a folder. Is there away to
–automatically- have messages get routed to a folder for a specific type of
message class? In other words, I have a message class from a specific
provider (IPM.Note.CustomClass) that is received by Outlook. Instead of the
message ending up in the inbox I would like to automatically end up in
another folder. I know I could capture an event and move the message to that
folder; but is there another way?
Thanks,
Tom –
Archived from group: microsoft>public>outlook>program_addins |
|
| Back to top |
|
 |
Ken Slovak - [MVP - Outlo
Joined: 12 Aug 2007 Posts: 405
|
Posted: Thu Oct 18, 2007 8:45 pm Post subject: Re: Message Class and Folder assignment |
|
|
At a level we can access using the Outlook object model everything comes
into Inbox and can be routed from there. I'm not sure if you can intercept
things before Inbox using Extended MAPI but that would be the only
possibility other than Inbox or if you wrote your own store provider (again
Extended MAPI).
--
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
"Tom at GSD" wrote in message @microsoft.com...
> Hello,
>
> I am trying to map a message class to a folder. Is there away to
> –automatically- have messages get routed to a folder for a specific type
> of
> message class? In other words, I have a message class from a specific
> provider (IPM.Note.CustomClass) that is received by Outlook. Instead of
> the
> message ending up in the inbox I would like to automatically end up in
> another folder. I know I could capture an event and move the message to
> that
> folder; but is there another way?
>
> Thanks,
> Tom –
> |
|
| Back to top |
|
 |
Tom at GSD
Joined: 14 Aug 2007 Posts: 7
|
Posted: Thu Oct 18, 2007 6:05 pm Post subject: Re: Message Class and Folder assignment |
|
|
Hi Ken,
I have written my own store provider. I originally created a transport that
was working like a charm, but my customer wanted their own store folder. I
then wrote the message store code. I am confused as to how to connect the
actual store (same DLL as transport provider) to a MAPI folder. If you have
any insight as to how to do that I would grealy appreciate it.
Thanks,
Tom -
"Ken Slovak - [MVP - Outlook]" wrote:
> At a level we can access using the Outlook object model everything comes
> into Inbox and can be routed from there. I'm not sure if you can intercept
> things before Inbox using Extended MAPI but that would be the only
> possibility other than Inbox or if you wrote your own store provider (again
> Extended MAPI).
>
> --
> 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
>
>
> "Tom at GSD" wrote in message
> @microsoft.com...
> > Hello,
> >
> > I am trying to map a message class to a folder. Is there away to
> > –automatically- have messages get routed to a folder for a specific type
> > of
> > message class? In other words, I have a message class from a specific
> > provider (IPM.Note.CustomClass) that is received by Outlook. Instead of
> > the
> > message ending up in the inbox I would like to automatically end up in
> > another folder. I know I could capture an event and move the message to
> > that
> > folder; but is there another way?
> >
> > Thanks,
> > Tom –
> >
>
> |
|
| Back to top |
|
 |
Tom at GSD
Joined: 14 Aug 2007 Posts: 7
|
Posted: Thu Oct 18, 2007 7:01 pm Post subject: Re: Message Class and Folder assignment |
|
|
Hi Ken,
I believe I found the proper procedure for what I am trying to accomplish in
MSDN -- "Opening a Message Store"
Thanks for your help.
"Ken Slovak - [MVP - Outlook]" wrote:
> At a level we can access using the Outlook object model everything comes
> into Inbox and can be routed from there. I'm not sure if you can intercept
> things before Inbox using Extended MAPI but that would be the only
> possibility other than Inbox or if you wrote your own store provider (again
> Extended MAPI).
>
> --
> 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
>
>
> "Tom at GSD" wrote in message
> @microsoft.com...
> > Hello,
> >
> > I am trying to map a message class to a folder. Is there away to
> > –automatically- have messages get routed to a folder for a specific type
> > of
> > message class? In other words, I have a message class from a specific
> > provider (IPM.Note.CustomClass) that is received by Outlook. Instead of
> > the
> > message ending up in the inbox I would like to automatically end up in
> > another folder. I know I could capture an event and move the message to
> > that
> > folder; but is there another way?
> >
> > Thanks,
> > Tom –
> >
>
> |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Thu Oct 18, 2007 8:35 pm Post subject: Re: Message Class and Folder assignment |
|
|
IMsgStore::GetReceiveFolderTable and IMsgStore::GetReceiveFolder were
designed to do exactly that.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Tom at GSD" wrote in message @microsoft.com...
> Hi Ken,
>
> I have written my own store provider. I originally created a transport
> that
> was working like a charm, but my customer wanted their own store folder. I
> then wrote the message store code. I am confused as to how to connect the
> actual store (same DLL as transport provider) to a MAPI folder. If you
> have
> any insight as to how to do that I would grealy appreciate it.
>
> Thanks,
> Tom -
>
>
>
>
>
>
> "Ken Slovak - [MVP - Outlook]" wrote:
>
>> At a level we can access using the Outlook object model everything comes
>> into Inbox and can be routed from there. I'm not sure if you can
>> intercept
>> things before Inbox using Extended MAPI but that would be the only
>> possibility other than Inbox or if you wrote your own store provider
>> (again
>> Extended MAPI).
>>
>> --
>> 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
>>
>>
>> "Tom at GSD" wrote in message
>> @microsoft.com...
>> > Hello,
>> >
>> > I am trying to map a message class to a folder. Is there away to
>> > -automatically- have messages get routed to a folder for a specific
>> > type
>> > of
>> > message class? In other words, I have a message class from a specific
>> > provider (IPM.Note.CustomClass) that is received by Outlook. Instead of
>> > the
>> > message ending up in the inbox I would like to automatically end up in
>> > another folder. I know I could capture an event and move the message to
>> > that
>> > folder; but is there another way?
>> >
>> > Thanks,
>> > Tom -
>> >
>>
>> |
|
| Back to top |
|
 |
Tom at GSD
Joined: 14 Aug 2007 Posts: 7
|
Posted: Fri Oct 19, 2007 10:11 am Post subject: Re: Message Class and Folder assignment |
|
|
Thanks Dmitry - that is exactly what I needed to know. By the time I am done
with this provider I think will have experience with almiost every extended
MAPI interface.
"Dmitry Streblechenko" wrote:
> IMsgStore::GetReceiveFolderTable and IMsgStore::GetReceiveFolder were
> designed to do exactly that.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Tom at GSD" wrote in message
> @microsoft.com...
> > Hi Ken,
> >
> > I have written my own store provider. I originally created a transport
> > that
> > was working like a charm, but my customer wanted their own store folder. I
> > then wrote the message store code. I am confused as to how to connect the
> > actual store (same DLL as transport provider) to a MAPI folder. If you
> > have
> > any insight as to how to do that I would grealy appreciate it.
> >
> > Thanks,
> > Tom -
> >
> >
> >
> >
> >
> >
> > "Ken Slovak - [MVP - Outlook]" wrote:
> >
> >> At a level we can access using the Outlook object model everything comes
> >> into Inbox and can be routed from there. I'm not sure if you can
> >> intercept
> >> things before Inbox using Extended MAPI but that would be the only
> >> possibility other than Inbox or if you wrote your own store provider
> >> (again
> >> Extended MAPI).
> >>
> >> --
> >> 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
> >>
> >>
> >> "Tom at GSD" wrote in message
> >> @microsoft.com...
> >> > Hello,
> >> >
> >> > I am trying to map a message class to a folder. Is there away to
> >> > -automatically- have messages get routed to a folder for a specific
> >> > type
> >> > of
> >> > message class? In other words, I have a message class from a specific
> >> > provider (IPM.Note.CustomClass) that is received by Outlook. Instead of
> >> > the
> >> > message ending up in the inbox I would like to automatically end up in
> >> > another folder. I know I could capture an event and move the message to
> >> > that
> >> > folder; but is there another way?
> >> >
> >> > Thanks,
> >> > Tom -
> >> >
> >>
> >>
>
>
> |
|
| Back to top |
|
 |
Tom at GSD
Joined: 14 Aug 2007 Posts: 7
|
Posted: Mon Oct 22, 2007 7:13 pm Post subject: Re: Message Class and Folder assignment |
|
|
Hi Dmitry,
I hope you can take a few minutes and tell me what I am doing wrong - it
would be greatly appreciated.
I have tried a variety of ways to change the message class on my store
folder from Outlook but I run into a road block with every approach. Again my
goal is that all messages from our provider will go to a specified folder in
our msg store. So Essenitally I have the following folder tree of
[-]MyMsgPST
----- Inbox
I am using the below code and every time I try to set the receive (inbox)
folder in my msg store with the new message class I get ACCESS DENIED. Am I
even close to the correct way to change the message class?
Thanks,
Tom
void SetupMessageClassForInbox(CComQIPtr
spSession)
{
SizedSPropTagArray(2, sptStoreProps) =
{
2,
{
PR_DISPLAY_NAME,
PR_ENTRYID
}
};
try
{
ULONG uFlags = 0;
CComPtr spTable;
spSession->GetMsgStoresTable(0, &spTable);
if(spTable != NULL)
{
if(SUCCEEDED(spTable->SetColumns((LPSPropTagArray)&sptStoreProps, 0)))
{
LPSRowSet pProviderRows;
HRESULT hResult = HrQueryAllRows(spTable,
(SPropTagArray*)&sptStoreProps,
NULL,
NULL,
0,
&pProviderRows);
if(SUCCEEDED(hResult))
{
BOOL bFound = FALSE;
for(int nRecp = 0; nRecp cRows; nRecp++)
{
TString s = pProviderRows->aRow[nRecp].lpProps[0].Value.lpszW;
if(s.find(_T("MyMsgPST")) != TString::npos)
{
CComPtr spStore;
HRESULT hr = spSession->OpenMsgStore(0,
pProviderRows->aRow[nRecp].lpProps[1].Value.bin.cb,
(LPENTRYID)pProviderRows->aRow[nRecp].lpProps[1].Value.bin.lpb,
NULL,
0,
&spStore);
if(SUCCEEDED(hr) && spStore)
{
SPropValue* pPropEID = NULL;
hr = HrGetOneProp(spStore, PR_IPM_SUBTREE_ENTRYID, &pPropEID);
if(SUCCEEDED(hr))
{
ULONG ulObjType = 0;
CComPtr spFolder;
CComPtr spParentFolder;
hr = spStore->OpenEntry(
pPropEID->Value.bin.cb,
(LPENTRYID)pPropEID->Value.bin.lpb,
NULL, uFlags, &ulObjType,
(LPUNKNOWN*)&spParentFolder);
if(SUCCEEDED(hr))
{
CComPtr spTblHier;
hr = spParentFolder->GetHierarchyTable(uFlags, &spTblHier);
if(SUCCEEDED(hr))
{
LPSRowSet pRowSet = NULL;
SizedSPropTagArray(4, sptFolderProps) =
{
4,
{
PR_ENTRYID,
PR_DISPLAY_NAME,
PR_SUBFOLDERS,
PR_CONTAINER_CLASS
}
};
hr = HrQueryAllRows(spTblHier,
(LPSPropTagArray)&sptFolderProps,
NULL, NULL, 0, &pRowSet);
for(int ind = 0; ind cRows; ind++)
{
TString strCurrentFolder =
pRowSet->aRow[ind].lpProps[1].Value.lpszW;
if(strCurrentFolder.find("Inbox") != TString::npos)
{
hr = spStore->SetReceiveFolder(
MESSAGE_CLASS, 0,
pRowSet->aRow[ind].lpProps[0].Value.bin.cb,
(LPENTRYID)pRowSet->aRow[ind].lpProps[0].Value.bin.lpb);
return;
}
}
}
}
}
}
break;
}
pProviderRows->aRow[nRecp].lpProps[1].Value;
ATLTRACE(_T("We are here\n"));
}
FreeProws(pProviderRows);
}
}
}
}
catch(...)
{
}
}
"Dmitry Streblechenko" wrote:
> IMsgStore::GetReceiveFolderTable and IMsgStore::GetReceiveFolder were
> designed to do exactly that.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Tom at GSD" wrote in message
> @microsoft.com...
> > Hi Ken,
> >
> > I have written my own store provider. I originally created a transport
> > that
> > was working like a charm, but my customer wanted their own store folder. I
> > then wrote the message store code. I am confused as to how to connect the
> > actual store (same DLL as transport provider) to a MAPI folder. If you
> > have
> > any insight as to how to do that I would grealy appreciate it.
> >
> > Thanks,
> > Tom -
> >
> >
> >
> >
> >
> >
> > "Ken Slovak - [MVP - Outlook]" wrote:
> >
> >> At a level we can access using the Outlook object model everything comes
> >> into Inbox and can be routed from there. I'm not sure if you can
> >> intercept
> >> things before Inbox using Extended MAPI but that would be the only
> >> possibility other than Inbox or if you wrote your own store provider
> >> (again
> >> Extended MAPI).
> >>
> >> --
> >> 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
> >>
> >>
> >> "Tom at GSD" wrote in message
> >> @microsoft.com...
> >> > Hello,
> >> >
> >> > I am trying to map a message class to a folder. Is there away to
> >> > -automatically- have messages get routed to a folder for a specific
> >> > type
> >> > of
> >> > message class? In other words, I have a message class from a specific
> >> > provider (IPM.Note.CustomClass) that is received by Outlook. Instead of
> >> > the
> >> > message ending up in the inbox I would like to automatically end up in
> >> > another folder. I know I could capture an event and move the message to
> >> > that
> >> > folder; but is there another way?
> >> >
> >> > Thanks,
> >> > Tom -
> >> >
> >>
> >>
>
>
> |
|
| Back to top |
|
 |
Tom at GSD
Joined: 14 Aug 2007 Posts: 7
|
Posted: Mon Oct 22, 2007 7:45 pm Post subject: Re: Message Class and Folder assignment |
|
|
Hi Dmitry,
Never mind my last message - I found my bug which not providing the proper
access parameters.
"Dmitry Streblechenko" wrote:
> IMsgStore::GetReceiveFolderTable and IMsgStore::GetReceiveFolder were
> designed to do exactly that.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Tom at GSD" wrote in message
> @microsoft.com...
> > Hi Ken,
> >
> > I have written my own store provider. I originally created a transport
> > that
> > was working like a charm, but my customer wanted their own store folder. I
> > then wrote the message store code. I am confused as to how to connect the
> > actual store (same DLL as transport provider) to a MAPI folder. If you
> > have
> > any insight as to how to do that I would grealy appreciate it.
> >
> > Thanks,
> > Tom -
> >
> >
> >
> >
> >
> >
> > "Ken Slovak - [MVP - Outlook]" wrote:
> >
> >> At a level we can access using the Outlook object model everything comes
> >> into Inbox and can be routed from there. I'm not sure if you can
> >> intercept
> >> things before Inbox using Extended MAPI but that would be the only
> >> possibility other than Inbox or if you wrote your own store provider
> >> (again
> >> Extended MAPI).
> >>
> >> --
> >> 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
> >>
> >>
> >> "Tom at GSD" wrote in message
> >> @microsoft.com...
> >> > Hello,
> >> >
> >> > I am trying to map a message class to a folder. Is there away to
> >> > -automatically- have messages get routed to a folder for a specific
> >> > type
> >> > of
> >> > message class? In other words, I have a message class from a specific
> >> > provider (IPM.Note.CustomClass) that is received by Outlook. Instead of
> >> > the
> >> > message ending up in the inbox I would like to automatically end up in
> >> > another folder. I know I could capture an event and move the message to
> >> > that
> >> > folder; but is there another way?
> >> >
> >> > Thanks,
> >> > Tom -
> >> >
> >>
> >>
>
>
>
|
|
| Back to top |
|
 |
|
|
| Related Topics: | Exchange folder and cached folder in OST file not in sync We have written a server application that periodically accesses certain folders in Exchange user's mailboxes (for which the server has permission) and moves the messages to the Deleted Items folder. The application is a service running on Windows XP or S
access mail from public folder Hi, I'm trying to use outlook 2003 and access mail from public folder. storeId and mail Count is giving result but access mail mi.Subject have no any output. I am losing any scop for public folder. mapiNamespace =
C++ Outlook Addin (New Folder Code) Hi, I'm developing a Outlook Addin, simply I want to create a new folder, at same level of Inbox folder, I'd tried some code, but the folder doesn't show. Neither if I try creating this folder inside the inbox folder, I'll like to get some code sample, i
Ribbon : What is the IdMso to catch "Message" with Outlook 2 Hi, I want to customize my Ribbon with Addin, I would want to know the Imdso to catch "Message" which is the first tab when i wite or reponse a mail. Tanks
recovered message folder?? How can I remove/hide the recovered message have no need for it. Thanks Barry/Austin |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|