Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Add-in Send Script

Geek News

Add-in Send Script
Bob Smith 7/26/2006 9:18:01 PM
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
Re: Add-in Send Script
Michael Bauer <mb[ at ]mvps.org> 7/27/2006 5:20:25 AM
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 --


[Quoted Text]
> 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
Re: Add-in Send Script
Bob Smith 7/27/2006 7:30:02 PM
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
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net