Deleting Attachments

  • Thread starter Thread starter Dan Cernoch
  • Start date Start date
D

Dan Cernoch

here is the code....

while(olMail.Attachments.Count != 0)
{
Outlook.Attachment olAtt = (Outlook.Attachment) ->cont.
olMail.Attachments[1];
Console.WriteLine(olAtt.FileName);
olAtt.Delete();
}
here is what happens.
All FileNames are printed to screen
No Attachments are deleted.

Thoughts?
Thanks,
Dan
 
Doesn't look like you're saving the item after you delete the attachments.
 
THANK YOU SO MUCH!
-----Original Message-----
Doesn't look like you're saving the item after you delete the attachments.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Dan Cernoch said:
here is the code....

while(olMail.Attachments.Count != 0)
{
Outlook.Attachment olAtt = (Outlook.Attachment) - cont.
olMail.Attachments[1];
Console.WriteLine(olAtt.FileName);
olAtt.Delete();
}
here is what happens.
All FileNames are printed to screen
No Attachments are deleted.

Thoughts?
Thanks,
Dan


.
 
Back
Top