Writing a Word Add-In - Part 0






2.15/5 (14 votes)
Jan 11, 2005
3 min read

40011
Learn to write an add-in in C# that does everything a regular C# program does.
Introduction
I first wrote the article in Part I. But after writing it, based on some questions and some further information I have come across, I realized that there really needed to be a precursor article. So here is the information I wished I had started with.
One other note. If you are going to write an Add-In, it’s not a trivial task. While very little of it is difficult, there is a lot to learn. And throwing one together quickly without understanding the entire framework is an invitation to disaster. You have to learn this stuff to write an Add-In correctly. (I think in some respects writing an Add-In requires a better understanding of its framework than writing a standard Windows application.)
Books
The first two books are where you should start. Both are very well written and give you a very comprehensive guide to writing a Word Add-In. I wish I had known about these before I started – they would have saved me weeks of time and anguish. The additional books are very useful for specific needs.
- Microsoft .NET Development for Microsoft Office – Andrew Whitechapel.
- Developing Microsoft Office Solutions – Keb Bluttman.
- Office 2003 XML – Evan Lenz, Mary McRae, & Simon Laurent.
This primarily covers the new XML file formats for the Office applications. It does an excellent job of explaining WordML and a good job of explaining the other formats. If you need to understand the Office XML formats, start with this book.
- Microsoft Excel 97 Developer’s Kit – Baarns Consulting Group.
This includes among other things, the XLS file format. If you need to read or write XLS directly, this is your only source.
Web links
- Building your first Add-In, a step by step intro from Microsoft. It’s a good way to start.
- A step 2 from Microsoft for building your own Add-In. You probably won’t find this necessary but if you are still struggling, it walks you through some simple functionality.
- A ton of examples showing how to code up simple functionality. Check this out – you can use these.
- A number of medium complex samples of how to perform specific actions in an Add-In. If this covers what you are trying to do, just copy & paste.
- The Usenet group microsoft.public.office.developer.com.add_ins is the place to ask questions. Sometimes you get answers (always if you have a MSDN subscription), sometimes you don’t. But it’s the place to ask.
- The Office 2003 schemas and help file. When you install, look for the CHM file – it has just about everything in it.
- The Word 2000 PIAs are not available from Microsoft. Here is a set that I built.
- The WordML spec is not complete. This is a document I update regularly with what I believe are the correct interpretations of the undocumented and partially documented elements.
- The RTF spec is incomplete and over the years every application writing and reading RTF files has made its own unique assumptions about the spec. This is what I have learned. With WordML, I am guessing RTF is going to go away, for no other reason than that WordML is a lot more fully specified.
Copyright © 2005 by David Thielen – All Rights Reserved.
This article may be freely copied as long as it is copied in its entirety.