open attachments

  • Thread starter Thread starter Karsten Jung
  • Start date Start date
K

Karsten Jung

Hello together!

Perhaps you can help me.

var oAttachs = objMessage.Attachments;
var oAttach = oAttachs.Item(iAttach);

oAttach is the attachment I want to open.

Can I open it directly or do I have to save the attachment to the
FileSystem?

When the attachment must be saved to fileSystem, how can I remove the
file after e.g. word was closed?

I should not fill the disc ;-)

thanks, Karsten
 
You must save the attachment to the file system. You can use FileSystemObject methods to delete the file. See http://www.outlookcode.com/d/code/copyatts.htm for sample code.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue said:
You must save the attachment to the file system. You can use FileSystemObject methods to delete the file. See http://www.outlookcode.com/d/code/copyatts.htm for sample code.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers

Thank you, but I have to wait until word is closed, how to realize
this part? I cannot simply call FileSystemObject.Delete

Karsten
 
Maybe your application could periodically look to see if there is a Word temporary file (beginning with ~) to match the file you saved. You might get other ideas in a Word forum.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Karsten Jung said:
Thank you, but I have to wait until word is closed, how to realize
this part? I cannot simply call FileSystemObject.Delete

You must save the attachment to the file system. You can use FileSystemObject methods to delete the file. See http://www.outlookcode.com/d/code/copyatts.htm for sample code.
 
Back
Top