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 attachments to disk using rules?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 26th 06, 08:11 AM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Saving attachments to disk using rules?

Hello,

I'm trying to find a way to automatically save specific excel files attached
in an email to a folder on the PC. Outlook rules do not appear to include
this. Unfortunately my VB skills are very limited and I have been unable to
implement the previous solutions found in this board.

I have looked at some 3rd party software but after a little research realise
that a macro could be coded to achieve this. However in the long run 3rd
party software may be easier and I am open to any recommendations.

Emails arrive in the customers Inbox from a couple of specific senders
containing an excel file and we wish to automatically (if possible) save
these to a specific location for extraction into an Access database. I guess
I would be looking at finding *.xls and an object to specify the senders

I would appreciate your assistance in achieving this We are using Outlook
2003.

Many Thanks

Matt
Ads
  #2  
Old May 26th 06, 12:51 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Saving attachments to disk using rules?

These samples show various ways to save attachments:

http://www.fontstuff.com/outlook/oltut01.htm
http://www.outlookcode.com/codedetail.aspx?id=70
http://www.slovaktech.com/code_sampl...ripAttachments

If you're using Outlook 2002 or later, you can write less code by using a "run a script" rule action to execute a VBA procedure with a MailItem or MeetingItem as its parameter. That item is processed by the code:


Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
For Each att in msg.Attachments
att.SaveAsFile "c:\" & att.FileName
Next

Set att = Nothing
Set msg = Nothing
Set olNS = Nothing
End Sub

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

"Matt" wrote in message ...
Hello,

I'm trying to find a way to automatically save specific excel files attached
in an email to a folder on the PC. Outlook rules do not appear to include
this. Unfortunately my VB skills are very limited and I have been unable to
implement the previous solutions found in this board.

I have looked at some 3rd party software but after a little research realise
that a macro could be coded to achieve this. However in the long run 3rd
party software may be easier and I am open to any recommendations.

Emails arrive in the customers Inbox from a couple of specific senders
containing an excel file and we wish to automatically (if possible) save
these to a specific location for extraction into an Access database. I guess
I would be looking at finding *.xls and an object to specify the senders

I would appreciate your assistance in achieving this We are using Outlook
2003.

Many Thanks

Matt

 




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 07:55 PM.


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.