Unable to trap send event when replying to new mail

P

Paul_S

Hi,

I have a Outlook Com Add-in developed in VB6, its purpose is to file
outgoing emails and displays a VB Form with combo boxes when a user sends an
email. My users are using Outlook 2003.

I have been using the on send event to trigger the display of the VB Form,
this works in most cases however (i.e. when replying or forwarding mails
using the tool bar buttons or from within an open email). However I have
discoved a problem as follows:

When a user right clicks on a 'new email' (i.e. highlighted in bold in the
explorer window) and selects reply/reply All / forward, the on send event
does not appear to fire (as the form is not shown) when the reply email is
eventually sent.

If the email selected has already been read and the user right clicks to
send a reply the onsend event is trapped and I can display my form.

Hope this makes sense, any input greatfully received.

Thanks

Paul
 
K

Ken Slovak - [MVP - Outlook]

How are you instantiating the send event handler? Are you trapping
NewInspector and handling Item.Send or Application.ItemSend?
 
P

Paul_S

Hi Ken,

yes I am instantiating the send event handler, I was originally trying to
catch the Item_Send event and then displaying the popup, which was working
fine for sending a new mail item or responding to a previously read item
using reply or forward. But this did not seem to want to work when replying
to an unread email.

I've sort of got round it now by using the Application_Send event however I
am confused as to why the Item_Send event does not seem to get triggered.

Regards,

Paul
 
K

Ken Slovak - [MVP - Outlook]

I haven't seen ItemSend not fire, as long as I trap NewInspector and
instantiate one of my Inspector wrapper classes if it's a mail item. As long
as I get Inspector.CurrentItem as a MailItem in my wrapper and handle its
events I get Send.

I almost never use the Application's send event because it occurs later in
the sending cycle and by that time a lot of the things I'd be doing would be
too late, they have to be done in Item.Send.
 
P

Paul_S

Hi Ken,

I've managed to implement your Inspector Wrapper class and it works a treat
!! I can now catch the Item.Send event regardless of the mail item having
being previously unread.

Thanks very much

Paul
 
K

Ken Slovak - [MVP - Outlook]

Very good :)

Just make sure to never, ever instantiate a wrapper class for Note items.
Everything else is OK. Note items are brain dead.
 

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