Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Real-Time Checking of New Messages

Geek News

Real-Time Checking of New Messages
"JahMic" <jahmic[ at ]gmail.com> 2/12/2007 11:47:59 AM
I have been charged with writing an Outlook add-in that would check
and possibly change certain messages upon receiving and sending
emails. I pretty familiar with Map, but don't know a lot about
programmable support for outlook itself. So, my questions are:

1. Is this possible? (check and change messages upon receiving and
sending)

2. What would be the best way to go about it? I'm a bit overwhelmed by
the options out there... There are VBA/Ole/COM-ish type of things,
Outlook Extension APIs, Outlook Api, Mapi Api, VS Shared addin, VSTO
type of project? I imagine some of these are different orientations on
essentially the objects, but I would like to not go down the wrong
path.

3. Since prefer a c# approach, (c++ is also nice) I'm thinking of a
VSTO addin. Any problems with this?

4. How do i get a hold of messages as they come in?

Thanks in advance,

J

Re: Real-Time Checking of New Messages
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 2/12/2007 3:42:10 PM
ItemAdd on the Items collection of the Inbox would work unless 16 or more
messages came in at once. Item.Send for individual items or
Application.ItemSend for a general approach to items being sent. Those are
the event handlers to use.

You can also use Application.NewMailEx to get a list of EntryID's for
incoming items.

VSTO can only be used with Outlook 2003 Professional or higher and Outlook
2007 (all SKU's), so what you have to support will determine if you can use
VSTO at all. VSTO is also a real chore to deploy, with the scattered
documentation, many hoops to go through and things to set up and making sure
all the prerequisites are installed.

..NET code in general will have many more requirements for successful
deployment than COM code (the correct framework and PIA's have to be
installed by an admin for one thing).

A shared addin using .NET code should really be shimmed to give it its own
AppDomain, to isolate it from other shared addins. However the shim wizard
currently does not work for Outlook 2007, if you need to support that.

In general, I'd usually recommend if you need to support Outlook 2002 or
2000 that you forget .NET code. It can be done but there are many additional
hoops to go through, such as having to custom modify the Outlook 2002 PIA's
for use with Outlook 2000 (there are no Outlook 2000 PIA's).

Also, .NET code can be significantly slower than pure COM code.

Extended MAPI can only be programmed using C++ or Delphi and is not
supported for .NET code. It has a longer learning curve than any other
method but is of course much faster, since all other Outlook API's are
wrappers for, or access, Extended MAPI under the hood.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"JahMic" <jahmic[ at ]gmail.com> wrote in message
news:1171280879.109386.281720[ at ]m58g2000cwm.googlegroups.com...
[Quoted Text]
>I have been charged with writing an Outlook add-in that would check
> and possibly change certain messages upon receiving and sending
> emails. I pretty familiar with Map, but don't know a lot about
> programmable support for outlook itself. So, my questions are:
>
> 1. Is this possible? (check and change messages upon receiving and
> sending)
>
> 2. What would be the best way to go about it? I'm a bit overwhelmed by
> the options out there... There are VBA/Ole/COM-ish type of things,
> Outlook Extension APIs, Outlook Api, Mapi Api, VS Shared addin, VSTO
> type of project? I imagine some of these are different orientations on
> essentially the objects, but I would like to not go down the wrong
> path.
>
> 3. Since prefer a c# approach, (c++ is also nice) I'm thinking of a
> VSTO addin. Any problems with this?
>
> 4. How do i get a hold of messages as they come in?
>
> Thanks in advance,
>
> J
>

Re: Real-Time Checking of New Messages
"JahMic" <jahmic[ at ]gmail.com> 2/14/2007 1:01:48 PM
Trying one more time...

Hi Ken,

Thanks for the excellent sumary of options. I have am pretty
comfortable with Com & Mapi, although I'm more of a c++ guy then a vb
guy. Can you direct me to some good 'hello world' type of samples out
there?

Thanks, J

On Feb 13, 12:42 am, "Ken Slovak - [MVP - Outlook]"
<kenslo...[ at ]mvps.org> wrote:
[Quoted Text]
> ItemAdd on the Items collection of the Inbox would work unless 16 or more
> messages came in at once. Item.Send for individual items or
> Application.ItemSend for a general approach to items being sent. Those are
> the event handlers to use.
>
> You can also use Application.NewMailEx to get a list of EntryID's for
> incoming items.
>
> VSTO can only be used with Outlook 2003 Professional or higher and Outlook
> 2007 (all SKU's), so what you have to support will determine if you can use
> VSTO at all. VSTO is also a real chore to deploy, with the scattered
> documentation, many hoops to go through and things to set up and making sure
> all the prerequisites are installed.
>
> .NET code in general will have many more requirements for successful
> deployment than COM code (the correct framework and PIA's have to be
> installed by an admin for one thing).
>
> A shared addin using .NET code should really be shimmed to give it its own
> AppDomain, to isolate it from other shared addins. However the shim wizard
> currently does not work for Outlook 2007, if you need to support that.
>
> In general, I'd usually recommend if you need to support Outlook 2002 or
> 2000 that you forget .NET code. It can be done but there are many additional
> hoops to go through, such as having to custom modify the Outlook 2002 PIA's
> for use with Outlook 2000 (there are no Outlook 2000 PIA's).
>
> Also, .NET code can be significantly slower than pure COM code.
>
> Extended MAPI can only be programmed using C++ or Delphi and is not
> supported for .NET code. It has a longer learning curve than any other
> method but is of course much faster, since all other Outlook API's are
> wrappers for, or access, Extended MAPI under the hood.
>
> --
> Ken Slovak
> [MVP - Outlook]http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm
>
> "JahMic" <jah...[ at ]gmail.com> wrote in message
>
> news:1171280879.109386.281720[ at ]m58g2000cwm.googlegroups.com...
>
>
>
> >I have been charged with writing an Outlook add-in that would check
> > and possibly change certain messages upon receiving and sending
> > emails. I pretty familiar with Map, but don't know a lot about
> > programmable support for outlook itself. So, my questions are:
>
> > 1. Is this possible? (check and change messages upon receiving and
> > sending)
>
> > 2. What would be the best way to go about it? I'm a bit overwhelmed by
> > the options out there... There are VBA/Ole/COM-ish type of things,
> > Outlook Extension APIs, Outlook Api, Mapi Api, VS Shared addin, VSTO
> > type of project? I imagine some of these are different orientations on
> > essentially the objects, but I would like to not go down the wrong
> > path.
>
> > 3. Since prefer a c# approach, (c++ is also nice) I'm thinking of a
> > VSTO addin. Any problems with this?
>
> > 4. How do i get a hold of messages as they come in?
>
> > Thanks in advance,
>
> > J- Hide quoted text -

Re: Real-Time Checking of New Messages
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 2/14/2007 2:37:29 PM
Well, the MS KB has examples of Extended MAPI code, as does the Exchange
SDK. There's a newsgroup for MAPI,
microsoft.public.win32.programmer.messaging, and a MAPI list, the MAPI-L
list.

You can also look at http://www.outlookcode.com/d/mapi.htm for more links
and code samples.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"JahMic" <jahmic[ at ]gmail.com> wrote in message
news:1171458107.182680.194980[ at ]v45g2000cwv.googlegroups.com...
[Quoted Text]
> Trying one more time...
>
> Hi Ken,
>
> Thanks for the excellent sumary of options. I have am pretty
> comfortable with Com & Mapi, although I'm more of a c++ guy then a vb
> guy. Can you direct me to some good 'hello world' type of samples out
> there?
>
> Thanks, J

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