Dela via


Writing Code in Office Solutions

There are some aspects of writing code in Visual Studio Tools for Office projects that are different from other types of projects. Many of these differences are related to the way the Microsoft Office object models are exposed in the primary interop assemblies. For example, the way in which you write code to call methods that have optional parameters in the Microsoft Office primary interop assemblies depends on the programming language you are using in your project. For more information, see The Variable missing and Optional Parameters in Office Solutions and Programming with Visual Basic vs. C# in Office Solutions.

Other differences are related to features that are unique to Visual Studio Tools for Office projects. For example, most Visual Studio Tools for Office projects include default Startup and Shutdown event handlers that act as the connection points between the Microsoft Office application and your solution code. The Startup event handler is where you run code that initializes your solution, and the Shutdown event handler is where you run code that cleans up your solution. For more information, see Visual Studio Tools for Office Project Events.

See Also

Tasks

How to: Create Event Handlers in Visual Studio Tools for Office

How to: Cast Objects Returned by Office Applications

Concepts

Supported Programming Languages in Visual Studio Tools for Office

Programming with Visual Basic vs. C# in Office Solutions

The Variable missing and Optional Parameters in Office Solutions

Visual Studio Tools for Office Project Events

Using My in Visual Studio Tools for Office Projects

Global Access to Objects in Visual Studio Tools for Office Projects

IntelliSense Code Snippets in Visual Studio Tools for Office

Collaborative Development of Office Solutions