A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Create a macro in Outlook to run a rule



 
 
Thread Tools Search this Thread Display Modes
  #11  
Old March 9th 10, 12:22 AM posted to microsoft.public.outlook.program_vba
DLGolfs
external usenet poster
 
Posts: 25
Default 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


.

Ads
  #12  
Old March 9th 10, 01:14 AM posted to microsoft.public.outlook.program_vba
DLGolfs
external usenet poster
 
Posts: 25
Default 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


.

  #13  
Old March 9th 10, 02:27 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

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


  #14  
Old March 10th 10, 12:58 AM posted to microsoft.public.outlook.program_vba
DLGolfs
external usenet poster
 
Posts: 25
Default 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


.

  #15  
Old March 10th 10, 12:59 AM posted to microsoft.public.outlook.program_vba
DLGolfs
external usenet poster
 
Posts: 25
Default 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


.

  #16  
Old March 10th 10, 01:23 AM posted to microsoft.public.outlook.program_vba
DLGolfs
external usenet poster
 
Posts: 25
Default 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


.

  #17  
Old March 10th 10, 02:26 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

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


  #18  
Old March 10th 10, 10:22 PM posted to microsoft.public.outlook.program_vba
DLGolfs
external usenet poster
 
Posts: 25
Default 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


.

  #19  
Old March 10th 10, 11:39 PM posted to microsoft.public.outlook.program_vba
DLGolfs
external usenet poster
 
Posts: 25
Default 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


.

  #20  
Old March 11th 10, 03:13 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

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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.