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

How can I automatically save attachments from inside a rule?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 24th 06, 08:20 PM posted to microsoft.public.outlook.program_vba
bobhody
external usenet poster
 
Posts: 1
Default How can I automatically save attachments from inside a rule?

I want to set up an Outlook rule that given a specific keyword in the subject
line, any attachments will be sent to a specific folder. The rule wizard
doesn't seem to provide this unless I use "run a script" or perform a "custom
action", neither of which seems to be available...
  #2  
Old May 24th 06, 11:19 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How can I automatically save attachments from inside a rule?

A "run a script" rule action actually uses not an external script but 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.
MsgBox msg.SUbject

Set msg = Nothing
Set olNS = Nothing
End Sub

See http://www.outlookcode.com/d/code/zaphtml.htm#ol2002 for another example.


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

"bobhody" wrote in message ...
I want to set up an Outlook rule that given a specific keyword in the subject
line, any attachments will be sent to a specific folder. The rule wizard
doesn't seem to provide this unless I use "run a script" or perform a "custom
action", neither of which seems to be available...

 




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
automatically save outgoing mail boggsandfishel_wendy Outlook - General Queries 1 April 12th 06 01:14 AM
How to save email addresses automatically from sent messages? Yo Outlook - Using Contacts 2 April 6th 06 01:30 PM
How can I automatically save all the contacts from recieved email? Sandman Outlook - Using Contacts 0 March 16th 06 06:15 AM
Rule doesn't run automatically [email protected] Outlook - General Queries 5 January 24th 06 03:21 PM
Export / save mail rule Wayne S Outlook Express 2 January 10th 06 06:41 AM


All times are GMT +1. The time now is 11:14 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.