Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / November 2004

Tip: Looking for answers? Try searching our database.

Saving email attachments in OUtlook using VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vbaffled - 04 Nov 2004 03:39 GMT
Can email attachments be saved WITHOUT opening the associated mail item using
VBA? There is an example in the VBA Help using the SaveAsFile Method but it
requires the Mail item to be open for it to work. If there is a way to save
the attachment without opening the email can someone please explain it to me.
Many thanks :-)
Michael Bauer - 04 Nov 2004 07:47 GMT
What do you mean with "without opening the email"? Do don´t need to
display the item but you will need a reference on it and for that it is
necessary, that OL is running.

Signature

Viele Grüße
Michael Bauer

> Can email attachments be saved WITHOUT opening the associated mail item using
> VBA? There is an example in the VBA Help using the SaveAsFile Method but it
> requires the Mail item to be open for it to work. If there is a way to save
> the attachment without opening the email can someone please explain it to me.
> Many thanks :-)
vbaffled - 04 Nov 2004 09:18 GMT
The example given in Outlook VBA Help opens an email item and then carries
out the SaveAsFile method to save the attachment. However, it seems that this
only applies to emails that have been opened to be read.

I do have Outlook running and I have tried to reference the items with
attachment but given my earlier comment about being new to the language of
Outlook VBA, I have not been successful so far - hence my question.

Following on from my two earlier posts asking about (1) counting email items
in a folder and (2) counting the number of email items with attachments (for
which I thank you again for your input Michael), I have incorporated the help
you provided for those posts to allow me to count email items with
attachments.

My next step is to save those same emails with attachments without opening
them to be read (like the Outlook Help example).

Hope this clears up what I meant earlier. I appreciate your comments.

> What do you mean with "without opening the email"? Do don´t need to
> display the item but you will need a reference on it and for that it is
[quoted text clipped - 9 lines]
> to me.
> > Many thanks :-)
Michael Bauer - 04 Nov 2004 09:58 GMT
Ok thanks, now I understand.

If, e.g., your loop looks like this...

for each item in folder.items
   ' ... at this point you can call item.saveas already without having
to display it.

Signature

Viele Grüße
Michael Bauer

> The example given in Outlook VBA Help opens an email item and then carries
> out the SaveAsFile method to save the attachment. However, it seems that this
[quoted text clipped - 28 lines]
> > to me.
> > > Many thanks :-)
vbaffled - 04 Nov 2004 22:43 GMT
Working fine now ...many thanks :-)

> Ok thanks, now I understand.
>
[quoted text clipped - 47 lines]
> > > to me.
> > > > Many thanks :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.