Creating rules in VBA

B

bp_soni

Hi

I am using outlook 2000

I want to create a rule in VBA that will move messags from a certain
user into a personal folder (that will already be present)

However I want to create a .VBS file with this code and send it to a
user as an attachement such that

1) the User will open the email

2) The user will double click on the file (with a .vbs) extension and
select to run the file from the curent location.

3) The Scripting File will add this rule to the Rules list for the
mailbox. The rule will then run each in the future that Outlook is
running.

Is this possible? I have looked on MSDN etc. Most examples using VBA
are saved as Macros and then run from there.

The only other optin that I can think of is if there is any way of
impoting a rule using code. I couldthen create the rule, export it to
file and send it along with a VBS file that will import it, but I have
not been aboe to find any examples of that either

Many Thanks

Bhupesh
 
K

Ken Slovak - [MVP - Outlook]

J

Jack Stockholm

Rules can't be created using VBA.

Is this true? Is there no way to automate rule creation? I would like to get
a rule installed on every desktop in the organization - does this mean that
I'm going to have to manually use the Rule Wizard on every machine (needs to
be a client rule, not an exchange rule)?

Thanks.
Jack
 
S

Sue Mosher [MVP]

It can be done with CDO and the Rules COM component, but it's not pretty -- you get server-side rules only and they're not visible to the user.

In your case, consider exporting a .rwz file.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top