View Single Post
  #2  
Old January 10th 07, 08:39 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How To Enable Macros in Outlook 2003 (XP Pro SP2)

Only class modules, ThisOutlookSession (a special case of a class module)
and forms (class modules with UI) can have declarations of WithEvents. Code
modules cannot.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"RON" wrote in message
...
I've looked but cannot find anything, including in the help; I've been to
Tools-Macro-Security in Outlook; set the security level to low, still
same
problem.

But I am more confused than this:

I have create a small project; Project1

Project 1
Microsoft Office Outlook
ThisOutlookSession
Modules
Module1

It looks like I"m in Module1.

The first statement is:

Public WithEvents outApp As Outlook.Application


but when I try to compile it "WithEvents" is flagged and invalid outside a
module.
BUt I'm in module1.

And, may be related, macros are not enabled.

Ron


Ads