Application_ItemSend does not "work"

M

MWE

I am running Outlook2000 and WinXP. I recently tried to
use Application_ItemSend and it did not "work". The
Application_Startup procedure works fine, but
Application_ItemSend procedure does not appear to be
called when a mail message is sent. Both are in
the "ThisOutlookSession" under "Microsoft Outlook Objects".

I have stripped out all code except a MsgBox indicating
that the procedure is executing:

Private Sub Application_ItemSend(ByVal Item As Object,
Cancel As Boolean)
'
'
MsgBox "Application_ItemSend procedure"
Cancel = False

End Sub


I never see the prompt, it does not matter whether Cancel
is set to True or False and any mail message goes right to
the OutBox.

Is there something else that needs to be done other than
put code into the procedure?

Thanks
 
S

Sue Mosher [MVP]

Check your setting under Tools | Macros | Security, restarting Outlook if
you change it. Then test with a small procedure to see if *any* VBA code
runs.
 
M

MWE

Sue: thanks for your reply.

There are dozens of VBA procedures that run just fine in
Outlook. The only one not working is Application_ItemSend.

MWE
 
S

Sue Mosher [MVP]

It won't fire if you create a message using the Send To shortcut in Windows
Explorer or the File | Send technique in any Office program. I've never
heard of a situation where other code in ThisOutlookSession runs but not an
ItemSend event handler.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

MWE

My testing has been from within Outlook. Any message sent
SHOULD trigger the Application_ItemSend procedure. None
do.

Any suggestinos re what I should do next?

Thanks
-----Original Message-----
It won't fire if you create a message using the Send To shortcut in Windows
Explorer or the File | Send technique in any Office program. I've never
heard of a situation where other code in
ThisOutlookSession runs but not an
 
S

Sue Mosher [MVP]

I'd run Help | Detect and Repair and possibly start with a fresh
vbaproject.otm file.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

MWE

Sue: Thanks (again) for you help.

I tried to run Detect and Repair but received a message
indicating a problem. After clicking the START button in
the Detect and Repair window, an error window popped up
with the following message:

The installation package could not be opened. Verify
that the package exists and you can access it, or
contact the application vendor that this is a valid
Windows Installer package.

I tried the Detect and Repair process in two other MS
Office applications and got the same error message. I
have the full Office2000 CD but the process never asked me
about it.

What am I doing wrong?

Also, how do I "... start with a fresh vbaproject.otm
file."?

Thanks

MWE
 
S

Sue Mosher [MVP]

If you rename the vbaproject.otm file that already exists on your system,
Outlook will create a new one.
 

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