![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
is there any way to execute rules with a macro? First I want to read all new mails an then klick a button to move them to other folders by the defined rules. G. |
Ads |
#2
|
|||
|
|||
![]()
No, you can execute VBA code with a rule, but not vice versa, at least not until Outlook 2007.
-- 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 "Gerd Neumann" wrote in message ... Hi, is there any way to execute rules with a macro? First I want to read all new mails an then klick a button to move them to other folders by the defined rules. G. |
#3
|
|||
|
|||
![]()
Could you please explain how to put the Macro in a rule. I have a macro
that works, but in the Rules Wizzard I can only find reference to scripts and custom actions. Thanks. Alan "Sue Mosher [MVP-Outlook]" wrote in message ... No, you can execute VBA code with a rule, but not vice versa, at least not until Outlook 2007. -- 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 "Gerd Neumann" wrote in message ... Hi, is there any way to execute rules with a macro? First I want to read all new mails an then klick a button to move them to other folders by the defined rules. G. |
#4
|
|||
|
|||
![]()
A "run a script" rule action in Outlook 2002 or 2003 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 "Alan in NJ" wrote in message ... Could you please explain how to put the Macro in a rule. I have a macro that works, but in the Rules Wizzard I can only find reference to scripts and custom actions. |
#5
|
|||
|
|||
![]()
Many thanks for the help. I'll give it a try.
Alan "Sue Mosher [MVP-Outlook]" wrote in message ... A "run a script" rule action in Outlook 2002 or 2003 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 "Alan in NJ" wrote in message ... Could you please explain how to put the Macro in a rule. I have a macro that works, but in the Rules Wizzard I can only find reference to scripts and custom actions. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tacking Macro | Bob_BLC | Outlook and VBA | 8 | December 5th 07 07:00 AM |
macro security | Charlie | Outlook and VBA | 2 | August 10th 06 01:46 AM |
Error Macro? | belto | Outlook - General Queries | 1 | April 4th 06 06:23 PM |
outlook macro | matt | Outlook and VBA | 1 | January 30th 06 02:30 PM |
VB and outlook macro need help | jbullington | Outlook and VBA | 1 | January 10th 06 04:22 PM |