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

Problem with deleting attachments from mailitems attachment-collectionusing OOM 2000



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 26th 06, 04:08 PM posted to microsoft.public.outlook.program_addins
Darius
external usenet poster
 
Posts: 6
Default Problem with deleting attachments from mailitems attachment-collectionusing OOM 2000

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: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
Ads
  #2  
Old October 26th 06, 06:31 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Problem with deleting attachments from mailitems attachment-collection using OOM 2000

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

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Darius" wrote in message
...
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: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


  #3  
Old November 3rd 06, 12:17 PM posted to microsoft.public.outlook.program_addins
Darius
external usenet poster
 
Posts: 6
Default Problem with deleting attachments from mailitems attachment-collectionusing OOM 2000

Ken Slovak - [MVP - Outlook] schrieb:
Try getting each Attachment object and calling its own Delete method.

That was the solution.
Thanks a lot.
Darius Biss
 




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
Deleting Duplicate Mailitems Geoff Outlook and VBA 7 October 19th 06 04:21 PM
Outlook express deleting attachments!! Mando Outlook Express 3 September 2nd 06 08:38 AM
duplication of files? re deleting 'sent' attachments [email protected] Outlook Express 4 June 10th 06 06:09 PM
Deleting Attachments Dorian C. Chalom Outlook - General Queries 3 May 13th 06 08:59 PM
Deleting Attachments in Meeting Requests [email protected] Outlook - General Queries 0 March 30th 06 06:30 PM


All times are GMT +1. The time now is 05:18 AM.


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.