Thanks that works!
"Michael Bauer" wrote:
[Quoted Text] > Am Wed, 26 Jul 2006 14:18:01 -0700 schrieb Bob Smith: > > Bob, "Application" is the object to declare and "ItemSend" is one of its > events, which you can use after the declaration. > > The statement "WithEvents" is necessary to get events: > > Private WithEvents m_Application as Outlook.Application > > Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object, _ > ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _ > ByVal AddInInst As Object, custom() As Variant _ > ) > Set m_Application=Application > End Sub > > Private Sub m_Application_ItemSend(ByVal Item As Object, Cancel As Boolean) > 'Do Stuff > End Sub > > -- > Viele Gruesse / Best regards > Michael Bauer - MVP Outlook > -- www.VBOffice.net -- > > > > I have created an addin but I'm unsure how to declare the code that runs > when > > someone sends an email. I thought it would be something like this..... > > > > > > Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant) > > Dim Application_ItemSend As Outlook.Application > > End Sub > > > > Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) > > 'Do Stuff > > End Sub >
|