Chapter 2: Basics of Office Interoperability


This article is an excerpt from Microsoft .NET Development for Microsoft Office, from Microsoft Press (ISBN 0-7356-2132-2, copyright Microsoft Press 2005, all rights reserved).

The author, Andrew Whitechapel, spent several years on the .NET Enterprise Applications Development team at Microsoft Consulting Services in the United Kingdom. He has extensive experience developing Microsoft Officebased applications with Microsoft .NET managed code. Andrew is now a technical program manager on the Microsoft Visual Studio Tools for Office team.

No part of this chapter may be reproduced, stored in a retrieval system, or transmitted in any form or by any meanselectronic, electrostatic, mechanical, photocopying, recording, or otherwisewithout the prior written permission of the publisher, except in the case of brief quotations embodied in critical articles or reviews.

Download sample code.


Chapter 2, Part 1: Discusses managed interop assemblies for Microsoft Office XP and Microsoft Office 2003, and illustrates some basic interop projects with Microsoft Office Excel, Microsoft Office 97, Microsoft Office 2000, Microsoft Office Word, Microsoft Office Outlook, and Microsoft Office PowerPoint.

Chapter 2, Part 2: Discusses Microsoft Visual Studio .NET Office interop wizards, explains interface/class ambiguity in Microsoft C# and Microsoft Visual Basic .NET, and explains how to release COM objects by using simple garbage collection, the ReleaseCOMObject method, and AppDomain unloading.

Chapter 2, Part 3: Compares Visual Basic .NET and C#, and illustrates debugging interop solutions. Also includes a summary of the entire chapter.