View Single Post
  #27  
Old March 15th 10, 12:52 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Create a macro in Outlook to run a rule

In case you didn't know it all caps is hard to read and is considered as
shouting.

I have no idea what's going on. If you never get valid NameSpace, Store or
Rules collection objects obviously the code will never fire the rule. But
the code to get those objects should just work.

You are running this in Outlook 2007, with nothing in the code other than
what's been shown, and no errors are fired?

Select Tools, Trust Center and select the Macro Security tab. What is the
setting there? What about on the Programmatic Access tab?

Something is drastically wrong with your setup or there's something going on
that we're not being told about. Otherwise at minimum the line setting
NameSpace would work.

--
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
...


"Ken Slovak - [MVP - Outlook]" wrote:

So what happens if you press F8 after you hit the breakpoint? You should
be
in the line after setting colRules and colRules should not be Nothing and
should now have a + that you can expand to see properties such as Count,
THERE IS NO "PROPERTIES" AND NO "COUNT"


I GET THE FOLLOWING AND WHEN i EXPAND THE ONS THERE IS NO 'COUNT" JUST
ACCOUNTS, ADDRESS LISTS, APPLICATIONS, CATERGORIES, CURRENT USER, DEFAULT
STORE, FOLDERS MAPIOBJECT, PARENT SESSION, STORES, AND SYNCOBJECTS ...DO
YOU
MEAN ACCOUNT OR COUNT? THIS IS WHAT I SEE EVERYTIME, :
- : Module4 : : Module4/Module4
: oStore : Nothing : Store
: oNS : Nothing : NameSpace
: colRules : Nothing : Rules
: oRule : Nothing : Rule
OK, THEN F8 AND IT HIGHLIGHTS THE FIRST LINE AND NOTHING CHANGES AS YOU
SEE
ABOVE
THEN ANOTHER F8 AND IT HIGHLIGHTS THE SET ONS LINE AND NOTHING CHANGES AS
YOU SEE ABOVE
THEN ANOTHER F8 AND IT HIGHLIGHTS THE SET OSTORE LINE AND AGAIN NOTHING
CHANGES AS YOU SEE ABOVE AND SO ON
IF SOMETHING IS CHANGING IN THE EXPANSION, IT WOULD IMPOSSIBLE FOR ME TO
TELL UNLESS YOU DIRECT ME TO A CERTAIN PLACE


Ads