Perform a Basic Toolbar Task with VBA

  • Thread starter Thread starter RobC
  • Start date Start date
R

RobC

Hi,

Is there a way to perform a basic toolbar task with VBA in Outlook? All I
want to do is have a button to run a specific rule on unread mail. I have
look all over and through the Object Model but cannot find anything to do
something as simple as this. Just looking to shortcut the steps
Tools/Rules and Alerts/Run Rules Now/click on XSpam Rule then select unread
messages. As these Rule don't run well a startup I always need to manually
run them in the morning. Help! Thanks, Rob
 
Outlook rules can't be run programmatically. Your toolbar button would need to run an Outlook VBA macro (which you would have to write).
 
Sue, I write VB code for Excel and Visio and basically when I can't figure
out how to do something, I use the record Macro which doesn't exist in
Outlook and just new in Visio 2003. I was just trying to write a simple
shortcut and asign it to a button and looking at the Object Model didn't
see anything that resembled that part of the application. Tons to so with
Mail, Appointments, Calendar etc... but nothing under "Tools" in the App.
Thanks, Rob
 
Exactly. You can't automate the rules wizard. Instead, you would need to write code using Outlook objects to perform the same task that your rule performs. If you tell us what that task is, we might be able to point you toward some sample code.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I was trying to look at the Internet Header to see if "X-Spam-Status: Yes",
then move it to my Junk Email Folder. I got the GetNext thing working fine
but don't see the "Header" info anywhere. Thanks, Rob
 
Back
Top