![]() |
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
|
|||
|
|||
![]()
I created a rule in Outlook 2007 for e-mails that have certain words in the
subject line, to be deleted. I have checked the rule and made it first but it does not run. I have to run it manually but clicking tools, rules and alerts, run rules, etc. This is pain to do. All my other rules run with no problem, this is the only one that does not run. So I thought I would make a macro on the toolbar and then just click on that and not have to click on tools, rules, etc. How do I do that? |
#2
|
|||
|
|||
![]()
Sub RunRuleMyRule()
Application.Session.DefaultStore.GetRules.Item("my RuleName).Execute End Sub Customize the toolbar where you want the macro button and select the macro from the Macros collection in the customize dialog. It will be in the Commands tab under the Macros group. Drag it to where you want it. While in customize you can click your new button and change the name and other settings. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "DLGolfs" wrote in message ... I created a rule in Outlook 2007 for e-mails that have certain words in the subject line, to be deleted. I have checked the rule and made it first but it does not run. I have to run it manually but clicking tools, rules and alerts, run rules, etc. This is pain to do. All my other rules run with no problem, this is the only one that does not run. So I thought I would make a macro on the toolbar and then just click on that and not have to click on tools, rules, etc. How do I do that? |
#3
|
|||
|
|||
![]()
I was directed to this site, but I don't know anything about programming, I
apologize. I put the macro on the toolbar but it does not show any macros are created. That is my point, I have to create a macro and then I can run it from the toolbar, but don't know how to creat a macro in Outlook b/c there is no avenue to do it. I unfortunatley do not understand the "sub runrulemyrule()" stuff, I am sorry Why does only this rule not run? all the others run and I set them up the same way, it runs manually, but not automatically. ty "Ken Slovak - [MVP - Outlook]" wrote: Sub RunRuleMyRule() Application.Session.DefaultStore.GetRules.Item("my RuleName).Execute End Sub Customize the toolbar where you want the macro button and select the macro from the Macros collection in the customize dialog. It will be in the Commands tab under the Macros group. Drag it to where you want it. While in customize you can click your new button and change the name and other settings. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "DLGolfs" wrote in message ... I created a rule in Outlook 2007 for e-mails that have certain words in the subject line, to be deleted. I have checked the rule and made it first but it does not run. I have to run it manually but clicking tools, rules and alerts, run rules, etc. This is pain to do. All my other rules run with no problem, this is the only one that does not run. So I thought I would make a macro on the toolbar and then just click on that and not have to click on tools, rules, etc. How do I do that? . |
#4
|
|||
|
|||
![]()
I have no idea why one or the other of your rules isn't running
automatically, that has nothing to do with Outlook programming. That you can ask on one of the general Outlook groups. That code I showed is the macro. You use Alt+F11 to open the Outlook VBA project and open a code module there and put the code there, then it will show up as a macro. You just need to change the code to use the actual name of your rule rather than "myRuleName". -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "DLGolfs" wrote in message ... I was directed to this site, but I don't know anything about programming, I apologize. I put the macro on the toolbar but it does not show any macros are created. That is my point, I have to create a macro and then I can run it from the toolbar, but don't know how to creat a macro in Outlook b/c there is no avenue to do it. I unfortunatley do not understand the "sub runrulemyrule()" stuff, I am sorry Why does only this rule not run? all the others run and I set them up the same way, it runs manually, but not automatically. ty |
#5
|
|||
|
|||
![]()
OK here is what I did, the rules name is Delete spam:
Sub RunRuleDeleteSpam() Application.Session.DefaultStore.GetRules.Item "Delete Spam.Execute" End Sub When I try to run it I get a run time error, The operation failed. An object cannot be found. There is a number too. I have the rule set up as Delete spam then I made some changes and here is the string: Sub RunRuleDeleteSpam() Application.Session.DefaultStore.GetRules.Item Delete Spam.Execute End Sub now I am getting a syntax error I am trying, never did this in the past, please be patient ![]() "Ken Slovak - [MVP - Outlook]" wrote: I have no idea why one or the other of your rules isn't running automatically, that has nothing to do with Outlook programming. That you can ask on one of the general Outlook groups. That code I showed is the macro. You use Alt+F11 to open the Outlook VBA project and open a code module there and put the code there, then it will show up as a macro. You just need to change the code to use the actual name of your rule rather than "myRuleName". -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "DLGolfs" wrote in message ... I was directed to this site, but I don't know anything about programming, I apologize. I put the macro on the toolbar but it does not show any macros are created. That is my point, I have to create a macro and then I can run it from the toolbar, but don't know how to creat a macro in Outlook b/c there is no avenue to do it. I unfortunatley do not understand the "sub runrulemyrule()" stuff, I am sorry Why does only this rule not run? all the others run and I set them up the same way, it runs manually, but not automatically. ty . |
#6
|
|||
|
|||
![]()
Sub RunRuleDeleteSpam()
Application.Session.DefaultStore.GetRules.Item("De lete Spam").Execute End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "DLGolfs" wrote in message ... OK here is what I did, the rules name is Delete spam: Sub RunRuleDeleteSpam() Application.Session.DefaultStore.GetRules.Item "Delete Spam.Execute" End Sub When I try to run it I get a run time error, The operation failed. An object cannot be found. There is a number too. I have the rule set up as Delete spam then I made some changes and here is the string: Sub RunRuleDeleteSpam() Application.Session.DefaultStore.GetRules.Item Delete Spam.Execute End Sub now I am getting a syntax error I am trying, never did this in the past, please be patient ![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2007 rule won't start a macro | Dmitry Sotnikov | Outlook and VBA | 1 | August 1st 08 04:57 PM |
Create a Macro in Outlook | Bert | Outlook and VBA | 10 | July 2nd 08 08:32 PM |
Run macro through rule | Flash08 | Outlook - General Queries | 2 | December 20th 07 04:16 PM |
create Macro, Outlook 2007 - create is grayed out | Dave Horne[_2_] | Outlook - General Queries | 2 | November 4th 07 09:45 AM |
Create a macro that runs from a Rule | CF_business_analyst | Outlook and VBA | 8 | January 13th 06 05:12 PM |