PC Review


Reply
Thread Tools Rate Thread

creating a script from a macro

 
 
=?Utf-8?B?UiBD?=
Guest
Posts: n/a
 
      9th May 2007
hi,
i have a macro and i'm trying to set a rule. i selected to run a script
when the rule executes but i don't see the macro listed in the script list.
Please help?
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      9th May 2007
A "run a script" rule action requires 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.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm...ok.program_vba
--
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

"R C" <(E-Mail Removed)> wrote in message news:16A21063-EA52-48DC-B74B-(E-Mail Removed)...
> hi,
> i have a macro and i'm trying to set a rule. i selected to run a script
> when the rule executes but i don't see the macro listed in the script list.
> Please help?

 
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
How do I copy someone's Excel macro script in my Personal Macro bo numbersgal Microsoft Excel Misc 1 4th Sep 2008 04:23 PM
How to fix the whacky <script></script> bug in C# when dynamically creating javascript. andrew@transitionkiteboarding.com Microsoft ASP .NET 0 2nd Aug 2005 03:01 PM
Re: Creating an ERD from a script PeterHolmes Microsoft Windows 2000 0 10th Nov 2004 04:10 PM
Creating an ERD from a script Dave Lerner Microsoft Windows 2000 2 27th Oct 2004 05:00 PM
Creating a permissions script Bob Microsoft Windows 2000 Registry Archive 0 27th Aug 2003 08:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:36 PM.