A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Saving and Renaming Attachments



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 28th 06, 06:26 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Saving and Renaming Attachments

Am Thu, 27 Jul 2006 07:42:02 -0700 schrieb csergent:

The MailItem has an Attachment collection. You could loop through that and
save each object with SaveAsFile. That object also has a FileName property,
which you can read and use for the SaveAsFile method.

An example is availabe in the VBA help.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


I receive files that are attachments, usually .xls or .txt files. I would
like to write code that selects the attachment and saves it to the
appropriate location.

My files are usually named randomName.txt as I don't know what the name of
the file will be.

The step I go through now is to right click and then select save as and

then
name the file.


One step further- Sometimes I receive two files. They will have common

names
but might place the date or other variable in the name; how could I select
this through vba(the appropriate file and then save it)?

Example: I receive two attachments that are - file0725.txt and another

that
is named businessTooMuchInformation.txt. I would like to be able to select
each file in turn and save the them with the new name of: file.txt and
business.txt

How would I do this?

  #2  
Old July 28th 06, 03:31 PM posted to microsoft.public.outlook.program_vba
csergent
external usenet poster
 
Posts: 5
Default Saving and Renaming Attachments

Michael,
I will try this and let you know what the outcome is.
Thanks again.
Chris

"Michael Bauer" wrote:

Am Thu, 27 Jul 2006 07:42:02 -0700 schrieb csergent:

The MailItem has an Attachment collection. You could loop through that and
save each object with SaveAsFile. That object also has a FileName property,
which you can read and use for the SaveAsFile method.

An example is availabe in the VBA help.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


I receive files that are attachments, usually .xls or .txt files. I would
like to write code that selects the attachment and saves it to the
appropriate location.

My files are usually named randomName.txt as I don't know what the name of
the file will be.

The step I go through now is to right click and then select save as and

then
name the file.


One step further- Sometimes I receive two files. They will have common

names
but might place the date or other variable in the name; how could I select
this through vba(the appropriate file and then save it)?

Example: I receive two attachments that are - file0725.txt and another

that
is named businessTooMuchInformation.txt. I would like to be able to select
each file in turn and save the them with the new name of: file.txt and
business.txt

How would I do this?


  #3  
Old July 31st 06, 08:17 PM posted to microsoft.public.outlook.program_vba
csergent
external usenet poster
 
Posts: 5
Default This was helpful: Saving and Renaming Attachments

Michael,
This has worked very well. I click on the link that I receive in my e-mail
so that I can mark this as helpful but get sent to: "The Page You Have
Requested is Not Available." And then I click on the FAQ's page, but I wasn't
sure what to select since the problem was with the support page.

I hope that this message is noticed, because I do want give credit to the
users that help me out on this site.

Thanks again.
Chris

"Michael Bauer" wrote:

Am Thu, 27 Jul 2006 07:42:02 -0700 schrieb csergent:

The MailItem has an Attachment collection. You could loop through that and
save each object with SaveAsFile. That object also has a FileName property,
which you can read and use for the SaveAsFile method.

An example is availabe in the VBA help.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


I receive files that are attachments, usually .xls or .txt files. I would
like to write code that selects the attachment and saves it to the
appropriate location.

My files are usually named randomName.txt as I don't know what the name of
the file will be.

The step I go through now is to right click and then select save as and

then
name the file.


One step further- Sometimes I receive two files. They will have common

names
but might place the date or other variable in the name; how could I select
this through vba(the appropriate file and then save it)?

Example: I receive two attachments that are - file0725.txt and another

that
is named businessTooMuchInformation.txt. I would like to be able to select
each file in turn and save the them with the new name of: file.txt and
business.txt

How would I do this?


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
saving attachments T Outlook Express 1 April 16th 06 04:16 PM
saving attachments tom Outlook - General Queries 2 April 10th 06 05:17 PM
saving attachments andy Outlook Express 2 February 15th 06 12:51 PM
Saving Attachments Raj Mazumdar Outlook Express 14 January 22nd 06 11:40 AM
Saving Attachments [email protected] Add-ins for Outlook 0 January 11th 06 07:27 PM


All times are GMT +1. The time now is 05:11 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-2025 Outlook Banter.
The comments are property of their posters.