Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

An example of writing a Word 2003 Addin in C#

Hi,

I'm looking for a good example of writing a Word 2003
Addin in Visual Studio .Net using C#'t find a good
working example I can download and bring into Visual Studio
.Net for a starting point. Can you help me with that?

Thanks Sooo Much
Gene

Eugene Mortimore
Wednesday, February 25, 2004

I'm new to C# so I can't answer your question but you might find something at one the links mentioned in http://discuss.fogcreek.com/dotnetquestions/default.asp?cmd=show&ixPost=3013

Christopher Wells
Friday, February 27, 2004

There are two different ways to develop addins for Word.  The traditional way is to support IDTExensibility2 interface, which lets you develop a general plugin that runs in the background of the Office application (e.g., an improved spell checker for Word or a new spam filter for Outlook.)

Here are some C# examples:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;316384
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cssample/html/vcsamwordautomationsampledemonstratesautomatingmicrosoftword.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexcl2k2/html/odc_offcs.asp
http://support.microsoft.com/?kbid=302901#2

Some of these examples are for Word XP, but they are equally applicable to Word 2003 (the automation model hasn't changed much.)

The new way is to use "Visual Studio Tools for the Microsoft Office System" development package.  This lets you write code that runs behind a particular document template.  E.g., you could create a sales report that automagically grabs data from a database and updates itself.

There are lots of examples here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/odc_ancVSTO.asp

Also, you'll find that most of the Office addin examples are written in VB.Net, but it should be pretty easy to translate them to C#:

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

Robert Jacobson
Friday, February 27, 2004

*  Recent Topics

*  Fog Creek Home