开发 Office 解决方案Develop Office solutions

使用 Visual Studio 中的 Office 开发人员工具设计项目并设置项目文件后,便可以开始集中精力实现代码和自定义用户界面 (UI)。After you design a project by using the Office developer tools in Visual Studio and set up the project files, you can begin to concentrate on implementing the code and custom user interface (UI).

适用于: 本主题中的信息适用于文档-级别项目和 VSTO 添加-在项目中。Applies to: The information in this topic applies to document-level projects and VSTO Add-in projects. 请参阅按 Office 应用程序和项目类型提供的功能See Features available by Office application and project type.

Note

有兴趣开发跨多个平台扩展 Office 体验的解决方案?Interested in developing solutions that extend the Office experience across multiple platforms? 查看新的 " Office 外接程序" 模型Check out the new Office Add-ins model. 与 VSTO 外接程序和解决方案相比,Office 外接程序的占用空间较小,可以使用几乎任何 web 编程技术(例如 HTML5、JavaScript、CSS3 和 XML)生成它们。Office Add-ins have a small footprint compared to VSTO Add-ins and solutions, and you can build them by using almost any web programming technology, such as HTML5, JavaScript, CSS3, and XML.

Office 解决方案编程模型Office solutions programming model

Office 对象模型公开各种可以编程的对象。The Office object model exposes a variety of objects that you can program against. 每当使用托管代码进行 Office 解决方案编程,都将编写使用 Office 主互操作程序集中的类型的代码。Whenever you program Office solutions by using managed code, you write code that uses types in the Office primary interop assemblies. 在使用 Visual Studio 中的 Office 项目模板创建的解决方案中,还编写直接针对项目中生成的类的代码。In solutions you create by using the Office project templates in Visual Studio, you also write code directly against generated classes in your project. 有关详细信息, 请参阅在 Office 解决方案中编写代码For more information, see Write code in Office solutions.

计划不同类型的 Office 解决方案Program different types of Office solutions

你正在创建的解决方案的类型确定你可以在项目中使用的功能。The type of solution that you are creating determines which features you can use in your project. 例如,在设计时通过从 Visual Studio 中的 “工具箱” 拖放项,可以向文档级自定义项添加 Windows 窗体控件和扩展的 Office 控件(名为 主机控件 )。For example, you can add Windows Forms controls and extended Office controls (named host controls) to document-level customizations by dragging items from the Toolbox in Visual Studio at design time. 但是,如果你正在开发一个 VSTO 外接程序,通过编写代码,可以在运行时仅将这些种类的控件添加到文档。However, if you are developing a VSTO Add-in, you can only add these sorts of controls to documents at run time, by writing code.

有关特定于不同类型解决方案的功能的详细信息,请参阅以下主题:For more information about features that are specific to different types of solutions, see the following topics:

标题Title 描述Description
在 Office 解决方案中编写代码Write code in Office solutions 描述在 Office 解决方案中编写代码的各个方面。Describes different aspects of writing code in Office solutions.
程序 VSTO 外接程序Program VSTO Add-ins 提供对 VSTO 外接程序的编程模型和相关编程任务的概述。Provides an overview of the programming model of VSTO Add-ins and related programming tasks.
程序文档级自定义项Program document-level customizations 提供对文档级自定义项的编程模型和相关编程任务的概述。Provides an overview of the programming model of document-level customizations and related programming tasks.
Office UI 自定义Office UI customization 介绍可通过使用 VSTO 外接程序和文档级自定义项来自定义 Office 应用程序 UI 的不同方式。Describes the different ways that you can customize the UI of Office applications by using VSTO Add-ins and document-level customizations.
Office 解决方案中的数据Data in Office solutions 介绍可以使用 Office 解决方案中的数据的不同方法,例如将数据绑定到控件和缓存文档级自定义项中的数据。Describes the different ways that you can work with data in Office solutions, such as binding data to controls and caching data in document-level customizations.
自动保存如何影响 Office 解决方案How AutoSave impacts Office solutions 描述在启用自动保存功能时, 您可能需要对 Office 解决方案进行的调整。Describes adjustments you might need to make to Office Solutions when AutoSave is enabled.
排查 Office 解决方案问题Troubleshoot Office solutions 提供用于解决在创建 Office 解决方案时可能遇到的常见问题的提示。Provides tips for solving common problems that you might encounter when creating Office solutions.
Office 中的线程支持Threading support in Office 提供在 Office 解决方案中使用多个线程的概述。Provides an overview of working with multiple threads in Office solutions.
Office 项目中的辅助功能Accessibility in Office projects 描述 Office 解决方案中可用的辅助功能。Describes the accessibility features that are available in Office solutions.

请参阅See also