Deleting Attachments

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
 
S

Sue Mosher [MVP-Outlook]

Doesn't look like you're saving the item after you delete the attachments.
 
D

Dan Cernoch

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


.
 

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