You cannot hardcode the property tag; it is a named property, you must call
IMessage::GetIDsFromNames first.
I don't know how those messages are mapped to the accounts, sorry. Did you
try to see if anything is available through the IOlkAccountManager (you can
access it through Misc | IOlkAccountManager in OutlookSpy)?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Rui Feng" wrote in message
...
I've written this and it works:
CComPtr IUnknown spUnknown;
CComPtr IMessage spIMessage;
spNewMail-get_MAPIOBJECT(&spUnknown);
spUnknown-QueryInterface(IID_IMessage, (void **)&spIMessage);
SPropTagArray Array;
LPSPropTagArray lpArray = &Array;
lpArray-cValues = 1;
lpArray-aulPropTag[0] = 0x80160102;
ULONG FAR lpcValues;
LPSPropValue lppPropArray;
HRESULT hr = spIMessage-GetProps(lpArray, NULL, &lpcValues,
&lppPropArray);
int nStrCount = lppPropArray-Value.bin.cb;
_bstr_t bstrPOPString((wchar_t *)lppPropArray-Value.bin.lpb);
char * cPOPString = bstrPOPString;
ATLTRACE("POPSTRING = %s\n", cPOPString);
I do not forget to free them like this:
MAPIFreeBuffer((void *)lpcValues);
MAPIFreeBuffer(lppPropArray);
The UIDL message id have been stored in bstrPOPString. The next step is to
add it to the corresponding attachment of hidden message. I don't know how
to
find the exact attachment because I have 3 "Deletedxxxxxxxx" files.
I cannot get its property tag like PR_XXXXXX style because it has no name
in
MAPITAGS.H file. Instead, I use 0x80160102 directly. Do you think its
property tag is different in other computers installed Outlook 2003?
Thank you.
"Dmitry Streblechenko" wrote:
No, it does not delete the message id.
Yes, you can access the list of message ids. If you are using CDO 1.21,
use
the Folder.HiddenMessages to find the corresponding message. Look at the
hidden messages with OutlookSpy (click IMAPIFolder, go to the "Associated
Contents" tab) or MFCMAPI.
I don't see however how that will help you - if you delete that message
id,
POP3 provider will assume that it is a new message and download it again.
This is the opposite of what you are trying to achieve.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Rui Feng" wrote in message
...
So do you think CDO "Message.Delete" method does not delete (maybe
forget
to
delete) message ids in that hidden message? If this is true, can my
add-in
access that hidden message in the Inbox and delete ids?
Thank you.
"Dmitry Streblechenko" wrote:
Outlook stores the list of the message ids in a hidden message
(PR_MESSAGE_CLASS = "IPM.MessageManager") in the Inbox.
However there is no way to tell the POP3 provider in Outlook to delete
a
particular message from a POP3 server.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Rui Feng" Rui wrote in message
...
Hi all.
My Outlook 2003 retrieves emails from a POP3 server. I set to "Leave
a
copy
of messages on the server" and "Remove from server when deleted from
'Deleted Items'". I wrote a COM Add-in using VC++ 6.0
When recieved a new mail from certain sender, I can catch the
ItemAdd event and use CDO Message-Delete() to permanently delete
that
new email. But the email has not been deleted from the POP3 server.
I guess there is a looking-up table in Outlook. When I delete an
Email
in
"Deleted Items Folder", Outlook find ID of that email and set a
value.
It
uses that value to notify the POP3 server next time to delete
corresponding
email
with the same ID on the server.
I think maybe CDO doesn't tell Outlook that "an email was deleted
and
please
tell
POP3 Server to delete the copy when connected next time".
Is that true and how to solve it? If you can do it using other
programming
language
like VB please tell me anyway.
Thank you. :-)
--------
Beijing, China