PC Review


Reply
Thread Tools Rate Thread

Saving email attachments in OUtlook using VBA

 
 
=?Utf-8?B?dmJhZmZsZWQ=?=
Guest
Posts: n/a
 
      4th Nov 2004
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 :-)
 
Reply With Quote
 
 
 
 
Michael Bauer
Guest
Posts: n/a
 
      4th Nov 2004
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.

--
Viele Grüße
Michael Bauer


"vbaffled" <(E-Mail Removed)> wrote in message
news2705C85-C244-4BFF-80DF-(E-Mail Removed)...
> 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 :-)


 
Reply With Quote
 
=?Utf-8?B?dmJhZmZsZWQ=?=
Guest
Posts: n/a
 
      4th Nov 2004
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.

"Michael Bauer" wrote:

> 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.
>
> --
> Viele Grüße
> Michael Bauer
>
>
> "vbaffled" <(E-Mail Removed)> wrote in message
> news2705C85-C244-4BFF-80DF-(E-Mail Removed)...
> > 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 :-)

>
>

 
Reply With Quote
 
Michael Bauer
Guest
Posts: n/a
 
      4th Nov 2004
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.

--
Viele Grüße
Michael Bauer


"vbaffled" <(E-Mail Removed)> wrote in message
news:B15F97E5-4A0A-4CB7-9961-(E-Mail Removed)...
> 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.
>
> "Michael Bauer" wrote:
>
> > 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.
> >
> > --
> > Viele Grüße
> > Michael Bauer
> >
> >
> > "vbaffled" <(E-Mail Removed)> wrote in message
> > news2705C85-C244-4BFF-80DF-(E-Mail Removed)...
> > > 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 :-)

> >
> >


 
Reply With Quote
 
=?Utf-8?B?dmJhZmZsZWQ=?=
Guest
Posts: n/a
 
      4th Nov 2004
Working fine now ...many thanks :-)


"Michael Bauer" wrote:

> 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.
>
> --
> Viele Grüße
> Michael Bauer
>
>
> "vbaffled" <(E-Mail Removed)> wrote in message
> news:B15F97E5-4A0A-4CB7-9961-(E-Mail Removed)...
> > 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.
> >
> > "Michael Bauer" wrote:
> >
> > > 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.
> > >
> > > --
> > > Viele Grüße
> > > Michael Bauer
> > >
> > >
> > > "vbaffled" <(E-Mail Removed)> wrote in message
> > > news2705C85-C244-4BFF-80DF-(E-Mail Removed)...
> > > > 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 :-)
> > >
> > >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem saving email attachments in Outlook 2003 using Vista Winter Walker Microsoft Outlook Discussion 6 26th Mar 2010 01:48 PM
Saving email attachments Dixon7 Microsoft Excel Misc 8 8th Jul 2009 06:43 PM
Saving email attachments Nigel RS Microsoft Outlook VBA Programming 6 24th Oct 2008 11:21 PM
saving email attachments =?Utf-8?B?bG9yZW4=?= Microsoft Outlook Discussion 1 16th Nov 2005 12:14 AM
saving outlook 2003 email messages to filesystem removes attachments Cameron Reed Microsoft Outlook Discussion 1 12th Jan 2004 12:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:52 PM.