Problem with deleting attachments from mailitems attachment-collectionusing OOM 2000

D

Darius

Hi,

I've written a COM-AddIn for Outlook using VC+ and OOM.

One of the functionality is to store emails as msg-file to disk without
any attachments.

<snip:>
...
Outlook::AttachmentsPtr pAttachments = m_pMailItem->Attachments;

lCount = pAttachments->Count;

for(lCount; lCount > 0; lCount--)
{
Outlook::AttachmentPtr pAttachment = pAttachments->Item(lCount);
if(CONDITION)
{
pAttachments->Remove(lCount);
}
}
}
...

m_pMailItem->SaveAs(strFilename, Outlook::eek:lMSG);

...
</snip:>

In Oulook 2002 and 2003 this code works fine and I'm getting my expected
msg-file without the deleted attachments before. But in Outlook2000
the stored msg-file contains all attachments anymore.


Any idea?

Best regards
Darius
 
K

Ken Slovak - [MVP - Outlook]

Try getting each Attachment object and calling its own Delete method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top