Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   open attachments (http://www.outlookbanter.com/outlook-vba/14729-open-attachments.html)

Karsten Jung May 15th 06 01:27 PM

open attachments
 
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


Sue Mosher [MVP-Outlook] May 15th 06 01:32 PM

open attachments
 
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Karsten Jung" wrote in message oups.com...
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


Karsten Jung May 15th 06 02:03 PM

open attachments
 

Sue Mosher [MVP-Outlook] schrieb:

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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


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

Karsten


Sue Mosher [MVP-Outlook] May 15th 06 02:18 PM

open attachments
 
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Karsten Jung" wrote in message ups.com...

Sue Mosher [MVP-Outlook] schrieb:

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.


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


"Sue Mosher [MVP-Outlook]" wrote in message ...
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.


"Karsten Jung" wrote in message oups.com...
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



All times are GMT +1. The time now is 05:07 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-2006 OutlookBanter.com