Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Create a macro in Outlook to run a rule (http://www.outlookbanter.com/outlook-vba/100634-create-macro-outlook-run-rule.html)

DLGolfs March 9th 10 12:22 AM

Create a macro in Outlook to run a rule
 
Just so I know that I am doing it correctly, through VB or Oulook, I chose
macro and run macro and click ok?

I did that and nothing happened :(

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

A module is a code module.

Sorry, that line should have been:

Set colRules = oStore.GetRules()

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


.


DLGolfs March 9th 10 01:14 AM

Create a macro in Outlook to run a rule
 
By the way, I made sure the changed was saved, closed OUtlook, then opened
it, enabled the macros and tried to run it.
I made sure I was in the file it is suppose to run the rule.

But nothing happened, no errors

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

A module is a code module.

Sorry, that line should have been:

Set colRules = oStore.GetRules()

--
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
...
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] March 9th 10 02:27 PM

Create a macro in Outlook to run a rule
 
You will need to set a breakpoint, step the code and see what's going on
with it. To do so click in your macro code on the Set colRules line in the
left hand border of the code module window. The line should then be
highlighted. When you run the macro it will stop on that line.

You can then step the code from there using F8. At each step you can use the
Immediate and Locals windows (View, Immediate Window and Locals Window) to
check the values of various variables and to output information. Then you
can see what's going on.

--
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
...
By the way, I made sure the changed was saved, closed OUtlook, then opened
it, enabled the macros and tried to run it.
I made sure I was in the file it is suppose to run the rule.

But nothing happened, no errors



DLGolfs March 10th 10 12:58 AM

Create a macro in Outlook to run a rule
 
ok, i tried to "set a break point" to "run to cursor" on several lines but
then when I do that , I try to run the macro, it still does nothing, I hit
continue and it goes through the lines and still nothing happens

I am sorry that I can't do this for you. I have built computers and run a
lot of applicaitons but have never programmed and I appreciate your patience.



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

You will need to set a breakpoint, step the code and see what's going on
with it. To do so click in your macro code on the Set colRules line in the
left hand border of the code module window. The line should then be
highlighted. When you run the macro it will stop on that line.

You can then step the code from there using F8. At each step you can use the
Immediate and Locals windows (View, Immediate Window and Locals Window) to
check the values of various variables and to output information. Then you
can see what's going on.

--
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
...
By the way, I made sure the changed was saved, closed OUtlook, then opened
it, enabled the macros and tried to run it.
I made sure I was in the file it is suppose to run the rule.

But nothing happened, no errors


.


DLGolfs March 10th 10 12:59 AM

Create a macro in Outlook to run a rule
 
It also said that it can't execute in breakmode

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

You will need to set a breakpoint, step the code and see what's going on
with it. To do so click in your macro code on the Set colRules line in the
left hand border of the code module window. The line should then be
highlighted. When you run the macro it will stop on that line.

You can then step the code from there using F8. At each step you can use the
Immediate and Locals windows (View, Immediate Window and Locals Window) to
check the values of various variables and to output information. Then you
can see what's going on.

--
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
...
By the way, I made sure the changed was saved, closed OUtlook, then opened
it, enabled the macros and tried to run it.
I made sure I was in the file it is suppose to run the rule.

But nothing happened, no errors


.


DLGolfs March 10th 10 01:23 AM

Create a macro in Outlook to run a rule
 
I was thinking and I see whatyou are trying to see, but if I put a breakpoint
and nothing happens then I don't see what that shows.

If it goes through 6 lines, let's say then how do we see if it works if all
the lines are not run ?
sorry, just thoughts

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

You will need to set a breakpoint, step the code and see what's going on
with it. To do so click in your macro code on the Set colRules line in the
left hand border of the code module window. The line should then be
highlighted. When you run the macro it will stop on that line.

You can then step the code from there using F8. At each step you can use the
Immediate and Locals windows (View, Immediate Window and Locals Window) to
check the values of various variables and to output information. Then you
can see what's going on.

--
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
...
By the way, I made sure the changed was saved, closed OUtlook, then opened
it, enabled the macros and tried to run it.
I made sure I was in the file it is suppose to run the rule.

But nothing happened, no errors


.


Ken Slovak - [MVP - Outlook] March 10th 10 02:26 PM

Create a macro in Outlook to run a rule
 
The idea is to see if the code runs without any errors, what the values of
the variables is at each step (for example Nothing for a Rules collection
tells us something, as does Nothing for the value of a Rule when you try to
get it), and what exactly is happening when each code line executes.

None of us can test or debug the code on your machine for you, obviously.

--
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 thinking and I see whatyou are trying to see, but if I put a
breakpoint
and nothing happens then I don't see what that shows.

If it goes through 6 lines, let's say then how do we see if it works if
all
the lines are not run ?
sorry, just thoughts



DLGolfs March 10th 10 10:22 PM

Create a macro in Outlook to run a rule
 
Sorry that I cannot do the programming that you want; but it does run without
errors, it is just that the "rule" does not run, when I mean "nothing" I mean
that the rulle does not run, it does not delete the spam in the junk folder.
No boxes open, nothing happens, like I did nothing.

I guess it just can't be done with a macro, thatnks for trying anyway, I'll
just have to do it manually, which is a real pain, but so be it.

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

The idea is to see if the code runs without any errors, what the values of
the variables is at each step (for example Nothing for a Rules collection
tells us something, as does Nothing for the value of a Rule when you try to
get it), and what exactly is happening when each code line executes.

None of us can test or debug the code on your machine for you, obviously.

--
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 thinking and I see whatyou are trying to see, but if I put a
breakpoint
and nothing happens then I don't see what that shows.

If it goes through 6 lines, let's say then how do we see if it works if
all
the lines are not run ?
sorry, just thoughts


.


DLGolfs March 10th 10 11:39 PM

Create a macro in Outlook to run a rule
 
What are values of the vairables? Is there a way to see that?

All I know is if I run it and/or brekapoint it , then it either does
nothing, that is litterally nothing happens OR it opens VB and shows me the
first line in yellow

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

The idea is to see if the code runs without any errors, what the values of
the variables is at each step (for example Nothing for a Rules collection
tells us something, as does Nothing for the value of a Rule when you try to
get it), and what exactly is happening when each code line executes.

None of us can test or debug the code on your machine for you, obviously.

--
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 thinking and I see whatyou are trying to see, but if I put a
breakpoint
and nothing happens then I don't see what that shows.

If it goes through 6 lines, let's say then how do we see if it works if
all
the lines are not run ?
sorry, just thoughts


.


Ken Slovak - [MVP - Outlook] March 11th 10 03:13 PM

Create a macro in Outlook to run a rule
 
Open the Locals window, that will show all variables in scope and their
values. I mentioned that earlier in the thread.

--
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
...
What are values of the vairables? Is there a way to see that?

All I know is if I run it and/or brekapoint it , then it either does
nothing, that is litterally nothing happens OR it opens VB and shows me
the
first line in yellow




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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com