Activating MS-Outlook 2000 Rules

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
shamigc
Junior Coder
Posts: 37
Joined: Wed Oct 22, 2003 11:38 am
Location: Monterrey, Mexico

Activating MS-Outlook 2000 Rules

Post by shamigc » Thu Aug 05, 2004 1:52 am

Hi,

I would like to develop a routine to enable/disable a rule, let's say its name is 'Rule_1', using VBScript. I need to disable Rule_1 at 9 am, and enable it at 7 pm. How can I enable/disable "Rule_1"?

Thanks,
Salvador Hernandez
Thanks,
Salvador Hernandez

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Aug 05, 2004 2:47 am

I suspect that you will have a better chance of a solution for this by uisng a forum for Outlook 2000. That is if you are commited to doing this with VBscript stuff.

Here is a link to Microsoft, Outlook overall. Expand the Outlook subject on the left for multiple newsgroups: Outlook NewsGroups.

Also some good VBA discussions at VBA Forums at Wrox publishing.

And some excellent VB code available from Helen Feddema at her site. Helen has good examples of integrating all Office Modules including Outlook.
Last edited by Bob Hansen on Fri Aug 06, 2004 3:47 am, edited 2 times in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Thu Aug 05, 2004 3:29 pm

I've thought about if it makes sense to swap (export/import) those different rule settings in one go. Like you would "update" a plain OE installation with your individual settings using an OE backup saved from an replaced box ( 8) )
The mail rules are stored at HKEY_CURRENT_USER\Identities. If you run Regedit and export this entire subkey to a file the same way you did with account settings: from the menu select Registry | Export Registry File. Save the file to a name like "rules.reg".

Restore (if necessary): Under the Identities key each subkey has a long number that looks similar to {36753740-2WEE-781D3-89B1-00A0C9900DSA}. So if you have five different identities in Outlook you will have five of these long numbers. Below the numbers are all the settings specific the the identity (signatures, mail rules,...). If you are restoring without reinstall and on the same PC these numbers do not change (as far as we know !) and you can just restore the registry entries by clicking on the reg file.
Taken from --> [here]

With Outlook it shouldn't be much different.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Aug 05, 2004 5:27 pm

Thanks Lumumba for that information. But as you noted, those instructions are for Outlook Express. Outlook is handled differently.

Outlook keeps its rules in a compiled file, name = *.rwz in folders for each Email account name like this:
C:\WINDOWS\Application Data\Microsoft\Outlook\EmailAccountName.RWZ

If kept in the registry like Outlook Express then it would be possible to run a macro at 9am to run RuleDef9Am.reg and run RuleDef7Pm.reg again at 7pm. Good idea, I like it.

=====================================

Hmmmm. maybe a similar thing can be done with *.rwz file. Swap RWZ files vs. different REG files. To set up the process, do this one time....
Open Outlook
Set rules for 9am decisions.
Close Outlook
Make a copy of current EmailAccountName.RWZ fille, to 9AM.rwz
Open Outlook
Change rules for 7pm decisions.
Close Outlook
Make a copy of current EmailAccountName.RWZ fille, to 7PM.rwz
----------------------

Now make macros 9amTo7pm and 7pmTo9am
Macros run at 9am and 7pm. CW_OVERWRITE=1
What they do is swap RWZ files, and keep current changes for next run :

9amTo7pm Macro:
Close Outlook
Copy current EmailAccountName.RWZ as 7PM.RWZ
Copy 9AM.RWZ to EmailAccountName.RWZ
Start Outlook

7pmTo9am Macro:
Close Outlook
Copy current EmailAccountName.RWZ as 9AM.RWZ
Copy 7PM.RWZ to EmailAccountName.RWZ
Start Outlook

----------------------
At least one problem will be that rules created/changed/deleted during one "shift" will not be incorporated into other "shift".

NOTE: This is all untested, just a concept that could be used as a starting point. If followed would be nice to hear feedback about how you actually did it.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Thu Aug 05, 2004 10:11 pm

At least one problem will be that rules created/changed/deleted during one "shift" will not be incorporated into other "shift".
Well, maybe that can be triggered with a check of the file modify date ... (?)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Aug 05, 2004 11:33 pm

Lumumba wrote:
At least one problem will be that rules created/changed/deleted during one "shift" will not be incorporated into other "shift".
Well, maybe that can be triggered with a check of the file modify date ... (?)
Possible, but not without human intervention.

Could compare for date change, and then flag a message that file was modified. Then would need to do the same thing as was done for initialization: Will have to open one version, make it correct for that shift, Save it for that shift. Make the changes for the other shift, and Save it for that shift. That is the problem, no way to automatically turn rules on/off without human intervention and editing.

======================
:idea: Hmmmm. WAIT...maybe Macro Scheduler can make the changes itself in Outlook vs. VB. ?
1. Open Outlook.
2. Click on Tools, Rules Wizard (opens window),
3. ALT-A (goes to window section with list of rules),
4. DOWN ?? number of times (highlights selected rule) (see below),
5. press +/- to set condition (SPACE toggles On/Off, see below)
6. Click OK (closes window).

Note for step 4:
Rules Window does allow you to move Rules Up/Down, so it seems that the position of the rules to toggle could be known, therefore the number of Down commands would also be known.

Note for step 5:
(Original steps above I suggested using SPACE) . There was no way to test for existing ON/OFF state, and no way to force to one condition of the other. SPACE will toggle to opposite of current state. So risk associated if someone manually toggles state during any period. Only problem now is to remember to modify Macro Script every time the rules are changed.
------
Subsequent note after writing section above. Changed step 4 from SPACE to +/- keys:
Hmmm, never mind this as a problem, there is a solution. Using the "+" and "-" keys turns condition ON/OFF vs. using the space bar as noted above. If already in that state, it does not toggle it.
=================================
:idea: I think we may have a sensible solution here after all! (Still a problem to keep accurate count of DOWN commands if Rules are added/deleted/moved up-down)

:D ......Done in Macro Scheduler script without VB script.
Use this technique vs. the file swap methods suggested earlier.

Structure is here, just need to write the script commands.......enjoy!:D
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Fri Aug 06, 2004 12:01 am

That's Bob :D

Lumumba

Post by Lumumba » Sun Aug 08, 2004 10:13 am

Get some [more ...] :D

Lumumba

Post by Lumumba » Sun Aug 08, 2004 10:36 am

Let's google !
Outlook start parameters
/folder
/select
/c ipm.note
/c ipm.post
/c ipm.appointment
/c ipm.task
/c ipm.contact
/c ipm.activity
/c ipm.stickynote
/checkclient
/m
/a
/CleanFreeBusy
/CleanReminders
/CleanViews
/CheckClient
/ResetFolders
/ResetOutlookBar
/NoPreview
/CleanSchedPlus
/Cleanprofile
/Cleanpst
/Safe
/Recycle
/Explorer
/Folder
/Profiles
/Profile
/s
/p
/Embedding
/c
/Cleanfinders
/f
/Regserver
/Unregserver
Outlook
/resetfoldernames
/altvba
/autorun
/cleansniff
/nopollmail
/nocustomize
/noextensions
/rpcdiag
:oops: Description for each param wasn't in english and I was to lazy to translate it. Sorry folks. Google is your friend (correction, as long as you don't own their shares :P )

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Aug 08, 2004 4:41 pm

Thanks Lumumba. Here is an English version of those Outlook Command Line Switches with syntax and explanations.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts