Y
Yaroslav
Can I somehow change the access right to IMessage mapi object?
When the message appears in the outbox I do the following
LPMESSAGE lpMessage = NULL;
HRESULT hRes = spMDB->OpenEntry( MessageId->Value.bin.cb,(LPENTRYID) MessageId->Value.bin.lpb, NULL, MAPI_BEST_ACCESS, &ulObjType,(LPUNKNOWN *)&lpMessage);
if (SUCCEEDED(hRes) && ulObjType == MAPI_MESSAGE)
{
SizedSPropTagArray(1,sptCols) = {1, PR_MY_PROP};
hRes = lpMessage->DeleteProps((LPSPropTagArray)&sptCols, 0);
hRes = lpMessage->SaveChanges(KEEP_OPEN_READWRITE);
... do some action on message and send it ....
}
But the lpMessage->DeleteProps returns error code that is access denied.
spMDB is the ATL::CComPtr<IMsgStore>
PR_MY_PROP is the property which I add in the BeforeMessageSend method handler (this I use to mark the message so that to handle this message only once since I receive several notification in the OnNotify method). I tried even with MAPI_BEST_ACCESS|MAPI_MODIFY but it also appears with no success.
Any ideas on this?
When the message appears in the outbox I do the following
LPMESSAGE lpMessage = NULL;
HRESULT hRes = spMDB->OpenEntry( MessageId->Value.bin.cb,(LPENTRYID) MessageId->Value.bin.lpb, NULL, MAPI_BEST_ACCESS, &ulObjType,(LPUNKNOWN *)&lpMessage);
if (SUCCEEDED(hRes) && ulObjType == MAPI_MESSAGE)
{
SizedSPropTagArray(1,sptCols) = {1, PR_MY_PROP};
hRes = lpMessage->DeleteProps((LPSPropTagArray)&sptCols, 0);
hRes = lpMessage->SaveChanges(KEEP_OPEN_READWRITE);
... do some action on message and send it ....
}
But the lpMessage->DeleteProps returns error code that is access denied.
spMDB is the ATL::CComPtr<IMsgStore>
PR_MY_PROP is the property which I add in the BeforeMessageSend method handler (this I use to mark the message so that to handle this message only once since I receive several notification in the OnNotify method). I tried even with MAPI_BEST_ACCESS|MAPI_MODIFY but it also appears with no success.
Any ideas on this?