Udostępnij za pośrednictwem


Creating Office Solutions in Visual Studio

You can develop solutions in Visual Studio to customize Microsoft Office applications and add the specific features you need for your business processes. For example, you can turn Microsoft Office Word into a contract generator that assembles contracts out of pre-existing parts that can be made editable or not editable. With Microsoft Office Excel, you could create an automated budget worksheet customized for different projects.

Creating Office Projects

Before you begin, you should determine your requirements and discover the type of solution that fits best. For example, if your Office solution must run every time the application is used, an application-level add-in best fits your requirements. If the code is tightly integrated with a single document, create a document-level customization. These project types are available as Visual Studio project templates. For more information about the project templates that are included with Visual Studio Tools for Office, see Visual Studio Tools for Office Project Templates Overview.

If you create a document-level customization, consider how it should be used by multiple people. Will everyone work on the same document, or should everyone have a separate copy of the document that they can personalize? There are project templates that are suitable for both types, which are documented in Document vs. Template Files.

If you create a Word template, you cannot use it as a global template or attach it to existing documents, Also, there is no project template for an Excel add-in file (.xla). For more information, see Limitations of Global Templates and Excel Add-ins (.xla Files)

Choosing a .NET Framework Version

After selecting the type of project that best fits your requirements, you have to choose what version of the .NET Framework to use in your development process. The version that you select affects which features are available to you, how the solution loads inside the Microsoft Office application, where you can put the solution installer, when updates are installed, and what deployment options are available to you.

The following table shows the minimum required versions of the .NET Framework if you want to develop for Microsoft Office 2003 or the 2007 Microsoft Office system.

Microsoft Office

.NET Framework

Visual Studio Tools for Office runtime

Microsoft Office 2003

.NET Framework 2.0

Visual Studio 2005 Tools for Office Second Edition

2007 Microsoft Office system

.NET Framework 3.5

Visual Studio Tools for Office 3.0

.NET Framework 3.5 SP1

Visual Studio Tools for Office 3.0 SP1

.NET Framework Client Profile (new in Visual Studio 2008 Service Pack 1 (SP1))

Visual Studio Tools for Office 3.0 SP1

For .NET Framework 2.0, 3.0, and 3.5, you can set the version of the .NET Framework when you create a new project. However, you can also change the version of the .NET Framework of your Office solution after project creation.

If you want to develop for .NET Framework Client Profile, you must set this option after the project is created. For more information about changing the target .NET Framework version, see How to: Change the Target .NET Framework.

Creating Solutions for Multiple Versions of Microsoft Office

If your customer base uses multiple versions of Microsoft Office, you can develop Office solutions that work in both. You must decide how to support and deploy a single solution that works in both Microsoft Office 2003 and the 2007 Microsoft Office system, or how to take advantage of features in different versions of Microsoft Office by deploying a version-specific solution. For more information, see Creating Solutions for Multiple Versions of Microsoft Office.

In This Section

See Also

Concepts

Deploying Office Solutions (2003 System)

Common Tasks in Office Programming

Developing Office Solutions

Other Resources

Architecture of Visual Studio Tools for Office Solutions

Change History

Date

History

Reason

July 2008

Added information about .NET Framework Client Profile and Visual Studio Tools for Office 3.0 SP1 runtime.

SP1 feature change.