Thread: Running a macro
View Single Post
  #2  
Old February 1st 06, 04:58 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Running a macro

Put code in the Inspectors.NewInspector event handler. This code needs to go into the built-in ThisOutlookSession module:

Dim WithEvents colInsp As Outlook.Inspectors

Private Sub Application_Startup()
Set colInsp = Application.Inspectors
End Sub

Private Sub colInsp_NewInspector(ByVal Inspector As Inspector)
Call yourMacro ' call your macro here
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"SuperSlueth" wrote in message ...
How do I get a macro to run automatically every time an email is
opened

Ads