Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2005

Tip: Looking for answers? Try searching our database.

Event handler not run

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
robw - 25 Jan 2005 19:53 GMT
Hi,

Within Outlook I have setup  an Application_ItemSend event handling routine
(This contains code to check/modify the  contents of the Subject line).
When I create and send  a new Mail Message from within Outlook this works
fine.

However, if I create a new Mail message by, for example, right-clicking a
file on my Desktop and choosing Send To-->Mail Recipient.....then compose my
message ..... then hit Send,  the event handling code is not executed !!.

Similarly, within Word (or other Office apps) , if I choose File--> Send To
--> Mail Recipient.....then Send, again my handler is not executed .

Why is this? ...and what can I do to fix it?
Michael Bauer - 28 Jan 2005 05:47 GMT
Hi,

you could use the Outbox ItemAdd event instead of Application_ItemSend.

Signature

Viele Grüße
Michael Bauer

> Hi,
>
[quoted text clipped - 11 lines]
>
> Why is this? ...and what can I do to fix it?
Ken Slovak - 28 Jan 2005 14:40 GMT
As far as I know that wouldn't work very well, Michael. If the item is put
into the Outbox by sending it then it has already been submitted to the mail
transport and if you try to manipulate the item you get all sorts of "item
has been moved or deleted" errors and in many cases the item goes out while
you are trying to work with it. Intercepting Item_Send or
Application_ItemSend is a better way to go I think.

Signature

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

> Hi,
>
> you could use the Outbox ItemAdd event instead of Application_ItemSend.
Michael Bauer - 28 Jan 2005 15:25 GMT
Oh oh, just this morning I´ve delivered a little solution, which is
using ItemAdd. It has to work on OL 2003 only, and I´ve tested without
problems. The only task is to save some mails into the filesystem,
depending on the recipients.

Please, Ken, would you tell me more?

Signature

Viele Grüße
Michael Bauer

> As far as I know that wouldn't work very well, Michael. If the item is put
> into the Outbox by sending it then it has already been submitted to the mail
[quoted text clipped - 6 lines]
> >
> > you could use the Outbox ItemAdd event instead of Application_ItemSend.
Ken Slovak - 31 Jan 2005 15:24 GMT
Michael,

It all depends on what you want to do with an item that's been added to the
Outbox as part of a send operation. If you want to copy it to the file
system you are OK. If you want to move the item to somewhere else you might
get an error since the item is being sent out. Just deleting the item could
also cause that error. It's really on a case by case basis as to what action
you are taking on an item.

Signature

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

> Oh oh, just this morning I´ve delivered a little solution, which is
> using ItemAdd. It has to work on OL 2003 only, and I´ve tested without
> problems. The only task is to save some mails into the filesystem,
> depending on the recipients.
>
> Please, Ken, would you tell me more?
Michael Bauer - 31 Jan 2005 16:17 GMT
Hi Ken,

thanks. The items only need to be copied. After doing that a
MailItem.Send call is necessary again, that´s all.

Now, after two days, I know it´s running fine. But having read your post
just after delivery there was a little bit of uneasy feeling. Thanks
again :-)

Signature

Viele Grüße
Michael Bauer

> Michael,
>
[quoted text clipped - 11 lines]
> >
> > Please, Ken, would you tell me more?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.