Visual Studio Office Project Types

In general, each Office application has a project type or family of project types available. Figure 22.3 shows the various project types available by expanding your chosen language node and then the Office node within the New Project dialog box.

Image

FIGURE 22.3 The available Office project types in Visual Studio.

For each version of Word and Excel, you see three project types: an add-in template and two document-level templates. The document-level templates enable you to target either document files (for Word, this is referred to as the Word Document project template, and for Excel, this is referred to as the Excel Workbook project template) or Office template files (for example, you can customize a Word template).

As previously discussed, the difference between an application-level add-in and a document extension is one of scope. When you compile an Office project, just as with every other project type in Visual Studio, a managed code assembly is generated. That assembly can be attached or linked to an Office application (for example, Word or Excel) or to an Office document (for example, a .doc/.docx file or an .xls/.xlsx file). Document-level assemblies are loaded only when the document is loaded and are limited in scope to the document. Application-level add-ins are loaded during application startup (although this can be controlled by the user) and are more global in their reach.


Note

Although Visual Studio fully supports Microsoft Office projects right out of the box (at least with the Visual Studio Professional version), you also need to have a copy of Microsoft Office and potentially various other components installed on your computer.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset