ItemSend only fired for new mail, not Reply, Replyall and Forward

  • Thread starter Thread starter xyz.info
  • Start date Start date
X

xyz.info

I used the following code to automatically BCC every email I sent in office
to my gmail account. But it only fired for a new mail item, not when I use
Reply or Forward actions. How to make it work for those events? Thanks!

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objMe As Recipient
Set objMe = Item.Recipients.Add("xyz.info@@@gamil.com")
objMe.Type = olBCC
objMe.Resolve
Set objMe = Nothing
End Sub
 
You will need to capture the Reply and Forward events for the MailItem
object. You can generally obtain that object through
ActiveInspector.CurrentItem, but you may require an Inspector wrapper for
advanced scenarios where multiple windows may be open.

--
Eric Legault [MVP - Outlook]
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, MOSS 2007
& WSS 3.0 Application Development)
Collaborative Innovations
NEW! -> Try Picture Attachments Wizard 2.0 For Microsoft Outlook <-
Web: http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault
 
I see that event fire whether I send a brand new message or a reply/forward.
What do you see in OutlookSpy if you click the Application button on the
OutlookSpy toolbar, go to the Events tab, and then create a reply and send
it?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Yes, after I installed OutlookSpy, the code did fired for reply. Then
after uninstalling OutlookSpy, it keeps working as planned under Reply.
But before today, it had never fired for a Reply. I will keep testing, and
let you know if anything interesting comes up. Thanks.
 
Back
Top