Add-in Send Script

G

Guest

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
 
M

Michael Bauer

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
 
G

Guest

Thanks that works!

Michael Bauer said:
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
 

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