delete attachment in public outlook folder  
Author Message
sl_nishu





PostPosted: Mon Nov 24 16:41:34 CST 2003 Top

VB Scripts >> delete attachment in public outlook folder

Hi,

when receiving a new message with attachment in a public outlook
folder I want to save the attachment to the file system and then
delete the attachment.
So far saving the attachment works fine:

For Each Item in TestFolder.Items
Set olAtt = Item.Attachments
olAtt.Item(1).SaveAsFile "D:\Test\" & olAtt.Item(1).FileName
Next

But I can not find a way to delete the attachment.
olAtt.Delete or olAtt.Remove will not work (maybe something missing?).
Can anybody help me

thanks
Stefan

Visual Studio110  
 
 
Michael





PostPosted: Mon Nov 24 16:41:34 CST 2003 Top

VB Scripts >> delete attachment in public outlook folder

: Hi,
:
: when receiving a new message with attachment in a public outlook
: folder I want to save the attachment to the file system and then
: delete the attachment.
: So far saving the attachment works fine:
:
: For Each Item in TestFolder.Items
: Set olAtt = Item.Attachments
: olAtt.Item(1).SaveAsFile "D:\Test\" & olAtt.Item(1).FileName
: Next
:
: But I can not find a way to delete the attachment.
: olAtt.Delete or olAtt.Remove will not work (maybe something missing?).
: Can anybody help me
:
: thanks
: Stefan


Do While email.Attachments.Count > 0
email.Attachments.Item(email.Attachments.Count).Delete
email.Save '<-----------this is probably the bit you're missing
Loop