Event handler not run

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
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?

--
Viele Grüße
Michael Bauer


Ken Slovak said:
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.
 
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.
 
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 :-)

--
Viele Grüße
Michael Bauer


Ken Slovak said:
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.
 
Back
Top