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

Run A SCRIPT - Select Script EMPTY



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 2nd 06, 07:52 PM posted to microsoft.public.outlook.program_vba
mitupan116
external usenet poster
 
Posts: 1
Default Run A SCRIPT - Select Script EMPTY


Hello ALL,

I need to download attachements from incoming mails and have a Macro
script to do the job. The macro seems to be working fine
independently.

I am able to execute it from TOOLS--Macro from (Outlook 2003) but I am
not able to automate the macro to be run from a RULE.

When I create rule and try to select the macro..the select script comes
as EMPTY. How do I attach the macro to the RULE and make it appear under
the SCRIPTS.

I have set macro security settings to LOW. Please help


--
mitupan116
------------------------------------------------------------------------
mitupan116's Profile: http://www.officehelp.in/member.php?userid=4936
View this thread: http://www.officehelp.in/showthread.php?t=1250199

Posted from - http://www.officehelp.in

Ads
  #2  
Old November 2nd 06, 10:36 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Run A SCRIPT - Select Script EMPTY

A "run a script" rule action requires not a macro, which has no arguments, 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.Body

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

"mitupan116" wrote in message ...

Hello ALL,

I need to download attachements from incoming mails and have a Macro
script to do the job. The macro seems to be working fine
independently.

I am able to execute it from TOOLS--Macro from (Outlook 2003) but I am
not able to automate the macro to be run from a RULE.

When I create rule and try to select the macro..the select script comes
as EMPTY. How do I attach the macro to the RULE and make it appear under
the SCRIPTS.

I have set macro security settings to LOW. Please help


--
mitupan116
------------------------------------------------------------------------
mitupan116's Profile: http://www.officehelp.in/member.php?userid=4936
View this thread: http://www.officehelp.in/showthread.php?t=1250199

Posted from - http://www.officehelp.in

 




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
Calendar - 'Run a script' henry Outlook - Calandaring 1 August 28th 06 09:34 PM
Run Script on New Mail Jcobb Outlook and VBA 1 August 21st 06 11:43 PM
Rule 'run a script' not running my script [email protected] Outlook and VBA 3 May 30th 06 01:09 PM
Script Not run in outlook 2003 Joey Outlook and VBA 4 May 19th 06 03:10 PM
"Run a script" rule triggers but script does not execute Trey Shaffer Outlook and VBA 7 April 8th 06 12:34 AM


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