Outlook events

From: John (john_at_nospam.infovis.co.uk)
Date: 02/19/04

Date: Thu, 19 Feb 2022 02:02:53 -0000


I am using outlook with withevents to grab its item_send event. It has not
worked so far. Anyone has any example of how this should be done? My code is
at the end.



= Code Follows ====================

Option Compare Database

Private WithEvents objOutlook As Outlook.Application
Private WithEvents objOutlookMsg As Outlook.MailItem

Private Sub Command0_Click()
  Dim objOutlookRecip As Outlook.Recipient

  Set objOutlook = CreateObject("Outlook.Application")
  Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
  eto = "me@mydomain.com"
  esubject = ""
  objOutlookMsg.To = eto
End Sub

Private Sub OutlookApp_ItemSend(ByVal Item As Object, ByRef Cancel As
  MsgBox "I am here"
End Sub