Visual Studio Tools for Office

Last updated

Visual Studio Tools for Office (VSTO) is a set of development tools available in the form of a Visual Studio add-in (project templates) and a runtime that allows Microsoft Office 2003 and later versions of Office applications to host the .NET Framework Common Language Runtime (CLR) to expose their functionality via .NET.

Contents

This allows extensions to the Office applications to be written in CLI compliant languages as well as to use functionality and user interface constructs from Office applications in .NET applications. [1] Extensions to Office prior to Office 2003 only allowed the creation of COM add-ins using Visual Basic or Visual C++ and a "Developer" edition was also offered that enabled VBA developers to create COM Add-ins.

VSTO supersedes developer editions of Office 2000 and Office XP for Office development. The developer editions of Office have been discontinued after Office XP and VSTO is available for Office 2003 and later versions only. The VSTO runtime, although part of VSTO development tools, is also downloadable separately if required. COM addin development is still possible for Office 2000 and all later versions using the Shared Add-in template in any version of Microsoft Visual Studio.

The VSTO add-ins (project types and controls) are also developed using Visual Studio. For Visual Studio .NET 2003 and Visual Studio 2005, it was available only as a standalone edition with support for .NET languages limited to Visual Basic.NET and C#. It was also included as a part of the Visual Studio Team System 2005.

Later on, the Visual Studio Tools for Office 2005 Second Edition (VSTO 2005 SE) was released as a free add-in to Visual Studio Professional and above that includes Office 2007 and 2003 support. However, for Visual Studio Professional Edition, it installs only the application-level add-ins; it does not add the document-level customizations or other functionality (actions pane, host controls, visual document designer, etc.) available in the full version of VSTO or Team System editions. [2] [3]

The current version is Visual Studio Tools for Office 2012 (VSTO 4.5) which is compatible with Office 2016, Office 2013, Office 2010, and Office 2007.

Comparison with VBA

Like VBA, code written for VSTO is executed by a separate virtual machine (the CLR) which is hosted inside the Microsoft Office applications. However, unlike VBA, where the code is stored in the document file itself, programs written with VSTO are stored in separate CLI assemblies which are associated with the documents by means of custom properties. [4]

If the properties are present, Microsoft Office hosts the CLR and loads the assembly specified in the property into a separate appdomain named after the document's name. [5] VSTO applications are subject to the .NET Framework Code Access Security constraints, in addition to the digital signature based permission model that governs VBA macros. [6]

VSTO development is normally performed using Visual Studio as used by professional programmers. The Office application is (re)started for each debugging session. VBA is normally developed from within the Office application and requires no special tools. VBA also has a macro recorder that can generate VBA code from user actions which is useful for non-professional programmers.

Comparison with JavaScript API

Office extensions or add-ins can be developed using VSTO and JavaScript API technologies. VSTO is Microsoft .NET technology and add-ins using JavaScript API technology use JavaScript, HTML and CSS.

JavaScript API add-ins are highly portable across platforms like iOS, mobile phones, tablets and Windows. The complete licensing process and cycle is easy and maintained within add-ins. Interactive visualization is feasible in JavaScript API add-ins using Charts, ClipArt and Maps.

JavaScript API add-in development is comparatively new technology and is introduced with Office 2016. There are limited APIs and functions available and supported.

VSTO has complete access to all Office object models. It is feasible to perform all operations on the Office client. Features that requires accessing local machine file systems and other applications are feasible and easy in VSTO. C# or any other CLI programming language can be used to create new Office add-ins.

VSTO compatibility and add-in functionality

The latest version of VSTO, as of 2018, is "Office Tools for Visual Studio" and is available with all versions of Microsoft Visual Studio 2017.

VSTO 2003, 2005, 3.0 and 2010 runtimes install in side-by-side (SxS) mode. VSTO 2005 SE runtime replaces the earlier VSTO 2005 runtime. VSTO 2010 runtime installs side-by-side with VSTO 3.0, however, Office 2007 applications can also use the VSTO 2010 runtime. All older VSTO solutions will continue to run in newer versions of Office as long as the runtime against which they were developed is installed.

VSTO solutions developed against newer Office versions will not work in older Office versions as they lack the necessary Primary Interop Assemblies (PIAs) [7] Office 2010 applications will always use VSTO 2010 Runtime. Design-time support is as follows:

VSTO runtime versionDevelop/Build against Office 2003Develop/Build against Office 2007Develop/Build against Office 2010 .NET version Available as
Document-levelApplication-levelDocument-levelApplication-levelDocument-levelApplication-level
VSTO 2003Word, Excel.NET 1.1Available only as Visual Studio .NET 2003 VSTO SKU
VSTO 2005Word, ExcelOutlook.NET 2.0, 3.0 or 3.5Available as Visual Studio 2005 VSTO SKU and part of Visual Studio 2005 Team System editions
VSTO 2005 SERequires VSTO 2005 for document-level customizationsWord, Excel, Outlook, PowerPoint, VisioInfoPathWord, Excel, Outlook, PowerPoint, Visio, InfoPath.NET 2.0, 3.0 or 3.5Downloadable for Visual Studio 2005 Professional and above, however document-level customizations require original VSTO 2005 (Standalone SKU or Team System editions)
VSTO 3.0Word, Excel (Builds against the VSTO 2005/2005 SE runtime)Word, Excel, Outlook, PowerPoint, Visio, Project (Builds against the VSTO 2005 SE runtime)Word, Excel, InfoPathWord, Excel, Outlook, PowerPoint, Visio, InfoPath, Project, SharePoint 2007 Workflows.NET 3.5Built into Visual Studio 2008 Professional and above
VSTO 4.0Word, ExcelWord, Excel, Outlook, PowerPoint, Visio, InfoPath, ProjectWord, ExcelWord, Excel, Outlook, PowerPoint, Visio, InfoPath, Project.NET 3.5 or 4.0Built into all versions of Visual Studio 2017

Code developed with various editions of VSTO will only work with certain releases and editions of Microsoft Office 2003 and related products. Specifically, VSTO solutions developed in editions prior to VSTO 2005 SE will not work with any edition of Office 2003 other than Professional. VSTO solutions developed with VSTO 2005 SE will work with Office 2003 Standard (only application-level add-ins) and Professional. VSTO 2005 SE solutions will work with all editions of Office 2007.

See also

Related Research Articles

The Common Language Infrastructure (CLI) is an open specification and technical standard originally developed by Microsoft and standardized by ISO/IEC and Ecma International that describes executable code and a runtime environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures. This implies it is platform agnostic. The .NET Framework, .NET and Mono are implementations of the CLI. The metadata format is also used to specify the API definitions exposed by the Windows Runtime.

<span class="mw-page-title-main">Microsoft Access</span> Database manager part of the Microsoft 365 package

Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational Access Database Engine (ACE) with a graphical user interface and software-development tools. It is a member of the Microsoft 365 suite of applications, included in the Professional and higher editions or sold separately.

Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer supported or updated by Microsoft, the VBA implementation in Office continues to be updated to support new Office features. VBA is used for professional and end-user development due to its perceived ease-of-use, Office's vast installed userbase, and extensive legacy in business.

<span class="mw-page-title-main">Microsoft Visual C++</span> Integrated development environment product by Microsoft

Microsoft Visual C++ (MSVC) is a compiler for the C, C++, C++/CLI and C++/CX programming languages by Microsoft. MSVC is proprietary software; it was originally a standalone product but later became a part of Visual Studio and made available in both trialware and freeware forms. It features tools for developing and debugging C++ code, especially code written for the Windows API, DirectX and .NET.

JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer web browser.

Managed Extensions for C++ or Managed C++ is a deprecated set of language extensions for C++, including grammatical and syntactic extensions, keywords and attributes, to bring the C++ syntax and language to the .NET Framework. These extensions were created by Microsoft to allow C++ code to be targeted to the Common Language Runtime (CLR) in the form of managed code, as well as continue to interoperate with native code.

Metadata, in the Common Language Infrastructure (CLI), refers to certain data structures embedded within the Common Intermediate Language (CIL) code that describes the high-level structure of the code. Metadata describes all classes and class members that are defined in the assembly, and the classes and class members that the current assembly will call from another assembly. The metadata for a method contains the complete description of the method, including the class, the return type and all of the method parameters.

Active Scripting is the technology used in Windows to implement component-based scripting support. It is based on OLE Automation and allows installation of additional scripting engines in the form of COM modules.

<span class="mw-page-title-main">Visual Basic (classic)</span> Microsofts programming language based on BASIC and COM

Visual Basic (VB) before .NET, sometimes referred to as Classic Visual Basic, is a third-generation programming language, based on BASIC, and an integrated development environment (IDE), from Microsoft for Windows known for supporting rapid application development (RAD) of graphical user interface (GUI) applications, event-driven programming and both consumption and development of components via the Component Object Model (COM) technology.

Comparison of the Java and .NET platforms.

<span class="mw-page-title-main">Visual Studio</span> Code editor and IDE

Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code.

Visual Studio Tools for Applications (VSTA) is a set of tools that independent software vendors (ISVs) can use to build customization abilities into their applications for both automation and extensibility. Those customization abilities can be used by end-users to tailor the ISV's application within a managed extensibility environment just like Visual Basic for Applications.

CS-Script is a free and open-source scripting platform that enables creating scripts in ECMA-compliant C# syntax. These scripts have access to .NET Framework or Mono APIs.

<span class="mw-page-title-main">.NET Framework</span> Software platform developed by Microsoft

The .NET Framework is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until being superseded by the cross-platform .NET project. It includes a large class library called Framework Class Library (FCL) and provides language interoperability across several programming languages. Programs written for .NET Framework execute in a software environment named the Common Language Runtime (CLR). The CLR is an application virtual machine that provides services such as security, memory management, and exception handling. As such, computer code written using .NET Framework is called "managed code". FCL and CLR together constitute the .NET Framework.

Windows Runtime (WinRT) is a platform-agnostic component and application architecture first introduced in Windows 8 and Windows Server 2012 in 2012. It is implemented in C++ and officially supports development in C++, Rust/WinRT, Python/WinRT, JavaScript-TypeScript, and the managed code languages C# and Visual Basic .NET (VB.NET).

<span class="mw-page-title-main">Mono (software)</span> Computer software project

Mono is a free and open-source .NET Framework-compatible software framework. Originally by Ximian, it was later acquired by Novell, and is now being led by Xamarin, a subsidiary of Microsoft and the .NET Foundation. Mono can be run on many software systems.

In computer science, bridging describes systems that map the runtime behaviour of different programming languages so they can share common resources. They are often used to allow "foreign" languages to operate a host platform's native object libraries, translating data and state across the two sides of the bridge. Bridging contrasts with "embedding" systems that allow limited interaction through a black box mechanism, where state sharing is limited or non-existent.

<span class="mw-page-title-main">.NET</span> Free and open-source software platform developed by Microsoft

The .NET platform is a free and open-source, managed computer software framework for Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft employees by way of the .NET Foundation and is released under an MIT License.

C++/WinRT is a C++ library for Microsoft's Windows Runtime platform, designed to provide access to modern Windows APIs. C++/WinRT is provided as a standard C++17 header file library, unlike C++/CX, which is an extension to C++ and requires a recent version of Microsoft Visual C++.

References

  1. "Office and SharePoint Development in Visual Studio". msdn.com. Microsoft.
  2. "Visual Studio 2005 Tools for the 2007 Office System (VSTO 2005 SE) Released to the Web". blogs.msdn.com. Microsoft. 9 November 2006.
  3. VSTO features available by product combination
  4. More on Word and Excel as CLR hosts
  5. "Another CLR hosts are shipped from Microsoft". Archived from the original on 2008-01-18. Retrieved 2008-01-16.
  6. VSTO Security Model
  7. VSTO Loader and Runtime Components