View Single Post
  #2  
Old July 7th 09, 02:12 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default trap outbound mail to update subject

It's impossible to determine what addin will run things in what order. It
depends on the load order of the addins (Outlook VBA is just another COM
addin) and which ones register for which events in which order.

If that addin is actually hooking to Application.ItemSend() then it might be
after or before a VBA hook. If the VBA code must be after the addin massages
the data then using an earlier event such as item.Send() wouldn't help, but
many addins do use that event rather than Application.ItemSend() since that
fires after the email transport is engaged and so is too late for some item
manipulations.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Alan Moseley" wrote in message
...
Hook into the Application.ItemSend event in the ThisOutlookSession code
window. It gets passed the email that is being sent so that you can
manipulate it:-

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim myItem As MailItem
If TypeName(Item) = "olMailItem" Then
Set myItem = Item
'Do something here such as call your routine passing the myItem
object
End If
End Sub

I guess that your addin is already hooking into this event, so I am not
sure
whether this would run before or after the addin, perhaps someone else can
advise.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


Ads