![]() |
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 |
#9
|
|||
|
|||
![]()
There is no code module only class module and module, so I used module.
cut and pasted, then ran and got run time error 438, Object does not support property or method, then it higlights this line: Set colRules = oStore.Rules "Ken Slovak - [MVP - Outlook]" wrote: The macro should be in a code module. So what happens? Do you get any errors or what? It might be necessary to expand that one-liner so you can see where things are failing. Let's try that: Sub RunRuleDeleteSpam() Dim oNS As Outlook.NameSpace Dim oStore As Outlook.Store Dim colRules As Outlook.Rules Dim oRule as Outlook.Rule Set oNS = Application.GetNameSpace("MAPI") Set oStore = oNS.DefaultStore Set colRules = oStore.Rules Set oRule = colRules.Item("Delete Spam") oRule.Execute End Sub Put your cursor in that macro in the VBA project and press F5. See what happens when the macro executes, if you get any errors or what. -- 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, copy , pasted below into the editor module, run "macro" from VBA and outlook and nothing happens, sorry I put in in a module and a design module and neither work. . |
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 |