Group:  Microsoft Outlook » microsoft.public.outlook.program_addins
Thread: add some text into an email automatically

Geek News

add some text into an email automatically
"Nader" <nader[ at ]infomaniak.ch> 5/1/2006 1:21:49 PM
Hi,

I'd like to add some text to the body of an e-mail after the user as click
on the send button. What is the best way to do that.

Thanks in advance.


Re: add some text into an email automatically
"Thaddaeus Parker" <tparker[ at ]microlinkllc.com> 5/2/2006 4:29:36 AM
Your best bet would be override the Send event for the current Item
Inspector and then add your text. I have seen the process written here
before, but for the life of me can't remember it exactly.

I will do some research and give you a definitive answer later today.

Regards,

Thaddaeus.
"Nader" <nader[ at ]infomaniak.ch> wrote in message
news:44560b69$0$13571$5402220f[ at ]news.sunrise.ch...
[Quoted Text]
> Hi,
>
> I'd like to add some text to the body of an e-mail after the user as click
> on the send button. What is the best way to do that.
>
> Thanks in advance.
>


Re: add some text into an email automatically
"Nader" <nader[ at ]infomaniak.ch> 5/2/2006 8:45:30 AM
thanks a lot !
"Thaddaeus Parker" <tparker[ at ]microlinkllc.com> a écrit dans le message de
news: exi8FEabGHA.1960[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> Your best bet would be override the Send event for the current Item
> Inspector and then add your text. I have seen the process written here
> before, but for the life of me can't remember it exactly.
>
> I will do some research and give you a definitive answer later today.
>
> Regards,
>
> Thaddaeus.
> "Nader" <nader[ at ]infomaniak.ch> wrote in message
> news:44560b69$0$13571$5402220f[ at ]news.sunrise.ch...
>> Hi,
>>
>> I'd like to add some text to the body of an e-mail after the user as
>> click on the send button. What is the best way to do that.
>>
>> Thanks in advance.
>>
>
>


Re: add some text into an email automatically
Denis Crotty 5/8/2006 4:59:01 PM
Hi,

I am looking into a similar function where I need to check the subject of
the outgoing email, did you get an example to start from on over riding the
send event?

--
Denis Crotty
Application Developer



"Nader" wrote:

[Quoted Text]
> thanks a lot !
> "Thaddaeus Parker" <tparker[ at ]microlinkllc.com> a écrit dans le message de
> news: exi8FEabGHA.1960[ at ]TK2MSFTNGP05.phx.gbl...
> > Your best bet would be override the Send event for the current Item
> > Inspector and then add your text. I have seen the process written here
> > before, but for the life of me can't remember it exactly.
> >
> > I will do some research and give you a definitive answer later today.
> >
> > Regards,
> >
> > Thaddaeus.
> > "Nader" <nader[ at ]infomaniak.ch> wrote in message
> > news:44560b69$0$13571$5402220f[ at ]news.sunrise.ch...
> >> Hi,
> >>
> >> I'd like to add some text to the body of an e-mail after the user as
> >> click on the send button. What is the best way to do that.
> >>
> >> Thanks in advance.
> >>
> >
> >
>
>
>
Re: add some text into an email automatically
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 5/8/2006 7:58:34 PM
Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim res As Long
If Item.Subject = "" Then
Cancel = True
strMsg = "Please fill in the subject before sending."
MsgBox strMsg, _
vbExclamation + vbSystemModal, "Missing Subject"
Item.Display
End If
End Sub

For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553

And for VBA basics, see http://www.outlookcode.com/d/vbabasics.htm


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:7DF530C8-54ED-444C-8E1C-1450C9F6CDF5[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> I am looking into a similar function where I need to check the subject of
> the outgoing email, did you get an example to start from on over riding the
> send event?
>
> --
> Denis Crotty
> Application Developer
>
>
>
> "Nader" wrote:
>
>> thanks a lot !
>> "Thaddaeus Parker" <tparker[ at ]microlinkllc.com> a écrit dans le message de
>> news: exi8FEabGHA.1960[ at ]TK2MSFTNGP05.phx.gbl...
>> > Your best bet would be override the Send event for the current Item
>> > Inspector and then add your text. I have seen the process written here
>> > before, but for the life of me can't remember it exactly.
>> >
>> > I will do some research and give you a definitive answer later today.
>> >
>> > Regards,
>> >
>> > Thaddaeus.
>> > "Nader" <nader[ at ]infomaniak.ch> wrote in message
>> > news:44560b69$0$13571$5402220f[ at ]news.sunrise.ch...
>> >> Hi,
>> >>
>> >> I'd like to add some text to the body of an e-mail after the user as
>> >> click on the send button. What is the best way to do that.
>> >>
>> >> Thanks in advance.
>> >>
>> >
>> >
>>
>>
>>
Re: add some text into an email automatically
Denis Crotty 5/8/2006 9:03:01 PM
How about in VB.NET? Do I start with implementing the IDTExtensibility2
interface?

How do I capture the new Mail event? Is that an inspector? Is this
documented somewhere?

I assume many people have written addins that check a property of every
outgoing message but I cannot seem to find an example to start from.


--
Denis Crotty
Application Developer



"Sue Mosher [MVP-Outlook]" wrote:

[Quoted Text]
> Private Sub Application_ItemSend _
> (ByVal Item As Object, Cancel As Boolean)
> Dim strMsg As String
> Dim res As Long
> If Item.Subject = "" Then
> Cancel = True
> strMsg = "Please fill in the subject before sending."
> MsgBox strMsg, _
> vbExclamation + vbSystemModal, "Missing Subject"
> Item.Display
> End If
> End Sub
>
> For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553
>
> And for VBA basics, see http://www.outlookcode.com/d/vbabasics.htm
>
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:7DF530C8-54ED-444C-8E1C-1450C9F6CDF5[ at ]microsoft.com...
> > Hi,
> >
> > I am looking into a similar function where I need to check the subject of
> > the outgoing email, did you get an example to start from on over riding the
> > send event?
> >
> > --
> > Denis Crotty
> > Application Developer
> >
> >
> >
> > "Nader" wrote:
> >
> >> thanks a lot !
> >> "Thaddaeus Parker" <tparker[ at ]microlinkllc.com> a écrit dans le message de
> >> news: exi8FEabGHA.1960[ at ]TK2MSFTNGP05.phx.gbl...
> >> > Your best bet would be override the Send event for the current Item
> >> > Inspector and then add your text. I have seen the process written here
> >> > before, but for the life of me can't remember it exactly.
> >> >
> >> > I will do some research and give you a definitive answer later today.
> >> >
> >> > Regards,
> >> >
> >> > Thaddaeus.
> >> > "Nader" <nader[ at ]infomaniak.ch> wrote in message
> >> > news:44560b69$0$13571$5402220f[ at ]news.sunrise.ch...
> >> >> Hi,
> >> >>
> >> >> I'd like to add some text to the body of an e-mail after the user as
> >> >> click on the send button. What is the best way to do that.
> >> >>
> >> >> Thanks in advance.
> >> >>
> >> >
> >> >
> >>
> >>
> >>
>
Re: add some text into an email automatically
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 5/8/2006 9:15:13 PM
For outgoing mail, you should use the Application_ItemSend event, as I indicated. The NewMail event would be used for incoming mail. The entire Outlook object model is documented in Outlook VBA help and on MSDN.

See http://www.outlookcode.com/d/comaddins.htm for links to COM add-in samples and references. IDTExtensibility2 is the interface you'll use, unless you're designing solely for Outlook 2003, in which case you can use Visual Studio 2005 Tools for Office, which shields the developer from many of the issues involved in building shared add-ins with earlier VS.NET versions.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:281E2F5A-F19E-47C4-BE2F-96D8E02C3954[ at ]microsoft.com...
[Quoted Text]
> How about in VB.NET? Do I start with implementing the IDTExtensibility2
> interface?
>
> How do I capture the new Mail event? Is that an inspector? Is this
> documented somewhere?
>
> I assume many people have written addins that check a property of every
> outgoing message but I cannot seem to find an example to start from.
>
>
> --
> Denis Crotty
> Application Developer
>
>
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> Private Sub Application_ItemSend _
>> (ByVal Item As Object, Cancel As Boolean)
>> Dim strMsg As String
>> Dim res As Long
>> If Item.Subject = "" Then
>> Cancel = True
>> strMsg = "Please fill in the subject before sending."
>> MsgBox strMsg, _
>> vbExclamation + vbSystemModal, "Missing Subject"
>> Item.Display
>> End If
>> End Sub
>>
>> For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553

>> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:7DF530C8-54ED-444C-8E1C-1450C9F6CDF5[ at ]microsoft.com...
>> > Hi,
>> >
>> > I am looking into a similar function where I need to check the subject of
>> > the outgoing email, did you get an example to start from on over riding the
>> > send event?

Re: add some text into an email automatically
Denis Crotty 5/8/2006 9:35:01 PM
Thanks Sue,

From what I have been reading I think I want to over ride the new inspector
event. Here is what I have so far:

Public Sub OnConnection(ByVal application As Object, ByVal connectMode As
Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
applicationObject = application
addInInstance = addInInst
insp = applicationObject.Inspectors
End Sub
Private Sub insp_NewInspector(ByVal InspectorIn As Inspector)
Dim objItem As Object
objItem = InspectorIn.CurrentItem
If objItem "is a mail item" Then
do custom action
end if
End Sub

I don't know whether this is the right idea as I am not sure how to test if
the obj is a mail item.


--
Denis Crotty
Application Developer



"Sue Mosher [MVP-Outlook]" wrote:

[Quoted Text]
> For outgoing mail, you should use the Application_ItemSend event, as I indicated. The NewMail event would be used for incoming mail. The entire Outlook object model is documented in Outlook VBA help and on MSDN.
>
> See http://www.outlookcode.com/d/comaddins.htm for links to COM add-in samples and references. IDTExtensibility2 is the interface you'll use, unless you're designing solely for Outlook 2003, in which case you can use Visual Studio 2005 Tools for Office, which shields the developer from many of the issues involved in building shared add-ins with earlier VS.NET versions.
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:281E2F5A-F19E-47C4-BE2F-96D8E02C3954[ at ]microsoft.com...
> > How about in VB.NET? Do I start with implementing the IDTExtensibility2
> > interface?
> >
> > How do I capture the new Mail event? Is that an inspector? Is this
> > documented somewhere?
> >
> > I assume many people have written addins that check a property of every
> > outgoing message but I cannot seem to find an example to start from.
> >
> >
> > --
> > Denis Crotty
> > Application Developer
> >
> >
> >
> > "Sue Mosher [MVP-Outlook]" wrote:
> >
> >> Private Sub Application_ItemSend _
> >> (ByVal Item As Object, Cancel As Boolean)
> >> Dim strMsg As String
> >> Dim res As Long
> >> If Item.Subject = "" Then
> >> Cancel = True
> >> strMsg = "Please fill in the subject before sending."
> >> MsgBox strMsg, _
> >> vbExclamation + vbSystemModal, "Missing Subject"
> >> Item.Display
> >> End If
> >> End Sub
> >>
> >> For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553
>
> >> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:7DF530C8-54ED-444C-8E1C-1450C9F6CDF5[ at ]microsoft.com...
> >> > Hi,
> >> >
> >> > I am looking into a similar function where I need to check the subject of
> >> > the outgoing email, did you get an example to start from on over riding the
> >> > send event?
>
>
Re: add some text into an email automatically
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 5/8/2006 9:55:13 PM
The NewInspector event fires when a new item opens in its own Inspector window. It has nothing to do with your stated goal:

[Quoted Text]
> >> > I am looking into a similar function where I need to check the subject of
> >> > the outgoing email

ItemSend, not NewInspector, is the event you would use to check the subject of an outgoing message.

> I don't know whether this is the right idea as I am not sure how to test if
> the obj is a mail item.

Check the value of its Class property.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:BC47D891-F07F-4721-8FE6-70297BD8CB22[ at ]microsoft.com...
> Thanks Sue,
>
> From what I have been reading I think I want to over ride the new inspector
> event. Here is what I have so far:
>
> Public Sub OnConnection(ByVal application As Object, ByVal connectMode As
> Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
> System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
> applicationObject = application
> addInInstance = addInInst
> insp = applicationObject.Inspectors
> End Sub
> Private Sub insp_NewInspector(ByVal InspectorIn As Inspector)
> Dim objItem As Object
> objItem = InspectorIn.CurrentItem
> If objItem "is a mail item" Then
> do custom action
> end if
> End Sub
>
> I don't know whether this is the right idea as I am not sure how to test if
> the obj is a mail item.
>
>
> --
> Denis Crotty
> Application Developer
>
>
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> For outgoing mail, you should use the Application_ItemSend event, as I indicated. The NewMail event would be used for incoming mail. The entire Outlook object model is documented in Outlook VBA help and on MSDN.
>>
>> See http://www.outlookcode.com/d/comaddins.htm for links to COM add-in samples and references. IDTExtensibility2 is the interface you'll use, unless you're designing solely for Outlook 2003, in which case you can use Visual Studio 2005 Tools for Office, which shields the developer from many of the issues involved in building shared add-ins with earlier VS.NET versions.
>>
>> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:281E2F5A-F19E-47C4-BE2F-96D8E02C3954[ at ]microsoft.com...
>> > How about in VB.NET? Do I start with implementing the IDTExtensibility2
>> > interface?
>> >
>> > How do I capture the new Mail event? Is that an inspector? Is this
>> > documented somewhere?
>> >
>> > I assume many people have written addins that check a property of every
>> > outgoing message but I cannot seem to find an example to start from.
>> >
>> > "Sue Mosher [MVP-Outlook]" wrote:
>> >
>> >> Private Sub Application_ItemSend _
>> >> (ByVal Item As Object, Cancel As Boolean)
>> >> Dim strMsg As String
>> >> Dim res As Long
>> >> If Item.Subject = "" Then
>> >> Cancel = True
>> >> strMsg = "Please fill in the subject before sending."
>> >> MsgBox strMsg, _
>> >> vbExclamation + vbSystemModal, "Missing Subject"
>> >> Item.Display
>> >> End If
>> >> End Sub
>> >>
>> >> For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553
>>
>> >> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:7DF530C8-54ED-444C-8E1C-1450C9F6CDF5[ at ]microsoft.com...
>> >> > Hi,
>> >> >
>> >> > I am looking into a similar function where I need to check the subject of
>> >> > the outgoing email, did you get an example to start from on over riding the
>> >> > send event?
>>
>>
Re: add some text into an email automatically
Denis Crotty 5/8/2006 10:54:02 PM
ahh, I see it now.

Here is what I have instead, going to test...


Dim WithEvents applicationObject As
Microsoft.Office.Interop.Outlook.Application

..
..
..

Private Sub applicationObject_ItemSend(ByVal Item As Object, ByRef Cancel As
Boolean) Handles applicationObject.ItemSend
MsgBox("You are sending Mail!!")
End Sub

I am assuming that I should see this message box every time I send...
--
Denis Crotty
Application Developer



"Sue Mosher [MVP-Outlook]" wrote:

[Quoted Text]
> The NewInspector event fires when a new item opens in its own Inspector window. It has nothing to do with your stated goal:
>
> > >> > I am looking into a similar function where I need to check the subject of
> > >> > the outgoing email
>
> ItemSend, not NewInspector, is the event you would use to check the subject of an outgoing message.
>
> > I don't know whether this is the right idea as I am not sure how to test if
> > the obj is a mail item.
>
> Check the value of its Class property.
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:BC47D891-F07F-4721-8FE6-70297BD8CB22[ at ]microsoft.com...
> > Thanks Sue,
> >
> > From what I have been reading I think I want to over ride the new inspector
> > event. Here is what I have so far:
> >
> > Public Sub OnConnection(ByVal application As Object, ByVal connectMode As
> > Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
> > System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
> > applicationObject = application
> > addInInstance = addInInst
> > insp = applicationObject.Inspectors
> > End Sub
> > Private Sub insp_NewInspector(ByVal InspectorIn As Inspector)
> > Dim objItem As Object
> > objItem = InspectorIn.CurrentItem
> > If objItem "is a mail item" Then
> > do custom action
> > end if
> > End Sub
> >
> > I don't know whether this is the right idea as I am not sure how to test if
> > the obj is a mail item.
> >
> >
> > --
> > Denis Crotty
> > Application Developer
> >
> >
> >
> > "Sue Mosher [MVP-Outlook]" wrote:
> >
> >> For outgoing mail, you should use the Application_ItemSend event, as I indicated. The NewMail event would be used for incoming mail. The entire Outlook object model is documented in Outlook VBA help and on MSDN.
> >>
> >> See http://www.outlookcode.com/d/comaddins.htm for links to COM add-in samples and references. IDTExtensibility2 is the interface you'll use, unless you're designing solely for Outlook 2003, in which case you can use Visual Studio 2005 Tools for Office, which shields the developer from many of the issues involved in building shared add-ins with earlier VS.NET versions.
> >>
> >> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:281E2F5A-F19E-47C4-BE2F-96D8E02C3954[ at ]microsoft.com...
> >> > How about in VB.NET? Do I start with implementing the IDTExtensibility2
> >> > interface?
> >> >
> >> > How do I capture the new Mail event? Is that an inspector? Is this
> >> > documented somewhere?
> >> >
> >> > I assume many people have written addins that check a property of every
> >> > outgoing message but I cannot seem to find an example to start from.
> >> >
> >> > "Sue Mosher [MVP-Outlook]" wrote:
> >> >
> >> >> Private Sub Application_ItemSend _
> >> >> (ByVal Item As Object, Cancel As Boolean)
> >> >> Dim strMsg As String
> >> >> Dim res As Long
> >> >> If Item.Subject = "" Then
> >> >> Cancel = True
> >> >> strMsg = "Please fill in the subject before sending."
> >> >> MsgBox strMsg, _
> >> >> vbExclamation + vbSystemModal, "Missing Subject"
> >> >> Item.Display
> >> >> End If
> >> >> End Sub
> >> >>
> >> >> For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553
> >>
> >> >> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:7DF530C8-54ED-444C-8E1C-1450C9F6CDF5[ at ]microsoft.com...
> >> >> > Hi,
> >> >> >
> >> >> > I am looking into a similar function where I need to check the subject of
> >> >> > the outgoing email, did you get an example to start from on over riding the
> >> >> > send event?
> >>
> >>
>
Re: add some text into an email automatically
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 5/9/2006 1:39:27 AM
Assuming that you have a statement somewhere to instantiate applicationObject, yes, that's what you should see.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:B748DB11-6B29-4192-A77D-AB4CA9405E61[ at ]microsoft.com...
[Quoted Text]
> ahh, I see it now.
>
> Here is what I have instead, going to test...
>
>
> Dim WithEvents applicationObject As
> Microsoft.Office.Interop.Outlook.Application
>
> .
> .
> .
>
> Private Sub applicationObject_ItemSend(ByVal Item As Object, ByRef Cancel As
> Boolean) Handles applicationObject.ItemSend
> MsgBox("You are sending Mail!!")
> End Sub
>
> I am assuming that I should see this message box every time I send...
> --
> Denis Crotty
> Application Developer
>
>
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> The NewInspector event fires when a new item opens in its own Inspector window. It has nothing to do with your stated goal:
>>
>> > >> > I am looking into a similar function where I need to check the subject of
>> > >> > the outgoing email
>>
>> ItemSend, not NewInspector, is the event you would use to check the subject of an outgoing message.
>>
>> > I don't know whether this is the right idea as I am not sure how to test if
>> > the obj is a mail item.
>>
>> Check the value of its Class property.
>> >
>> > "Sue Mosher [MVP-Outlook]" wrote:
>> >
>> >> For outgoing mail, you should use the Application_ItemSend event, as I indicated. The NewMail event would be used for incoming mail. The entire Outlook object model is documented in Outlook VBA help and on MSDN.
>> >>
>> >> See http://www.outlookcode.com/d/comaddins.htm for links to COM add-in samples and references. IDTExtensibility2 is the interface you'll use, unless you're designing solely for Outlook 2003, in which case you can use Visual Studio 2005 Tools for Office, which shields the developer from many of the issues involved in building shared add-ins with earlier VS.NET versions.
>> >>
>> >> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:281E2F5A-F19E-47C4-BE2F-96D8E02C3954[ at ]microsoft.com...
>> >> > How about in VB.NET? Do I start with implementing the IDTExtensibility2
>> >> > interface?
>> >> >
>> >> > How do I capture the new Mail event? Is that an inspector? Is this
>> >> > documented somewhere?
>> >> >
>> >> > I assume many people have written addins that check a property of every
>> >> > outgoing message but I cannot seem to find an example to start from.
>> >> >
>> >> > "Sue Mosher [MVP-Outlook]" wrote:
>> >> >
>> >> >> Private Sub Application_ItemSend _
>> >> >> (ByVal Item As Object, Cancel As Boolean)
>> >> >> Dim strMsg As String
>> >> >> Dim res As Long
>> >> >> If Item.Subject = "" Then
>> >> >> Cancel = True
>> >> >> strMsg = "Please fill in the subject before sending."
>> >> >> MsgBox strMsg, _
>> >> >> vbExclamation + vbSystemModal, "Missing Subject"
>> >> >> Item.Display
>> >> >> End If
>> >> >> End Sub
>> >> >>
>> >> >> For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553
>> >>
>> >> >> "Denis Crotty" <DenisCrotty[ at ]discussions.microsoft.com> wrote in message news:7DF530C8-54ED-444C-8E1C-1450C9F6CDF5[ at ]microsoft.com...
>> >> >> > Hi,
>> >> >> >
>> >> >> > I am looking into a similar function where I need to check the subject of
>> >> >> > the outgoing email, did you get an example to start from on over riding the
>> >> >> > send event?
>> >>
>> >>
>>

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