Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

How to build an Outlook add-in (C#)

I am currently looking into building an Outlook add-in using VS.NET and C#.

Does anyone have some pointers? I want to perform statistic analyses of e-mail messages.

Thanks.

BB King
Monday, February 09, 2004

In a word: don't.

Greg Reinacker (the author of NewsGator) and I are friends. We've had long discussions on what an evil thing it is to try to write Office add-ins from managed code, especially Outlook add-ins. Had to do it over, he says he would've abandoned C# for C++ and written it using ATL.

Brad Wilson (dotnetguy.techieswithcats.com)
Monday, February 09, 2004

Out of curiosity, what advantages does managed code give when writing office add-ins?

I have never written one personally, although I have a project coming up shortly which an Outlook add-in.

I would have presumed <insert complete ignorance here> that MS has provided some kind of interface to implement and you are off to the races.  No?

Any help is appreciated. 

Oh, and for what its worth, I would have written mine in Delphi regardless, given that the CLR isn't exactly widespread yet. 

But its great to get both perspectives.

Canuck
Tuesday, February 10, 2004

I also had problems making a C# addin work. I decided to write a proxy add-in with ATL that in turn calls the C# code. This works very reliable.

Hans
Tuesday, February 10, 2004

I've been writing a complex Word addin using VB.Net without any problems.  Lots of good information on MSDN:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office02072002.asp

http://msdn.microsoft.com/vcsharp/using/building/office/default.aspx

Here's one Outlook add-in tutorial that's written for VB.Net, but should be easy to translate to C#:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnout2k2/html/odc_oladdinvbnet.asp

Robert Jacobson
Tuesday, February 10, 2004

advantage? the managed code evironment is a joy to write in compared to most others.
disadvantage? most Office interfaces are designed for VBA and thus you have to do weird things from time to time in managed code. you probably also have to do weird things in C++, but they won't stick out quite so much.
i haven't tried to do anything in Outlook for a while, my previous experiments stopped when some documented functionality just did not work. at all.

mb
Wednesday, February 11, 2004

Are you deaf, dumb, blind and stupid?

Outlook with managed code rules! I've written my entire application with c#.  Use Visual Basic only if you are retarded below the groin!

Simon
Friday, February 13, 2004

If you want to distribute the add-in - I would avoid c#

Just built an add-in for a friend's company, initially used vba (sweet), then c# as it is what I know. The distribution problems with c# are serious. As well as .net, you need to get the user to install the primary interop assemblies, and if you want to target Outlook 2000 you need to recompile these. There are also other niggly problems, essentially caused by the fact that a) office is unmanaged code b) office integration is targeted at VB developers

Lots of good information at
http://www.microeye.com/resources/res_outlookvsnet.htm
and at
http://www.slipstick.com/dev/comaddins.htm
also
microsoft.public.outlook.program_addins


So you can build an add-in in c#, but if you want to distribute it and have an easy life, the trick is to use VB5 ! on  a clean install of Win2k professional and target Outlook 2000 (office 9). The use VMware for testing (thanks Joel)

jim dallas
Tuesday, February 24, 2004

*  Recent Topics

*  Fog Creek Home