Visual Studio Tools for Office
Encyclopedia
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
Runtime library
In computer programming, a runtime library is a special program library used by a compiler, to implement functions built into a programming language, during the execution of a computer program...

 that allows Microsoft Office
Microsoft Office
Microsoft Office is a non-free commercial office suite of inter-related desktop applications, servers and services for the Microsoft Windows and Mac OS X operating systems, introduced by Microsoft in August 1, 1989. Initially a marketing term for a bundled set of applications, the first version of...

 2003
Microsoft Office 2003
Microsoft Office 2003 is a productivity suite written and distributed by Microsoft for their Windows operating system. Released on October 21, 2003, it was the successor to Office XP and the predecessor to Office 2007.- Overview :...

 and later versions of Office applications to host the .NET Framework
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

 Common Language Runtime
Common Language Runtime
The Common Language Runtime is the virtual machine component of Microsoft's .NET framework and is responsible for managing the execution of .NET programs. In a process known as just-in-time compilation, the CLR compiles the intermediate language code known as CIL into the machine instructions...

 (CLR) to expose their functionality via the .NET type system
Common Type System
In Microsoft's .NET Framework, the Common Type System is a standard that specifies how Type definitions and specific values of Types are represented in...

. 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. Extensions to Office prior to Office 2003 only allowed creating COM
Component Object Model
Component Object Model is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages...

 add-ins using Visual Basic
Visual Basic
Visual Basic is the third-generation event-driven programming language and integrated development environment from Microsoft for its COM programming model...

 or Visual C++
Visual C++
Microsoft Visual C++ is a commercial , integrated development environment product from Microsoft for the C, C++, and C++/CLI programming languages...

 and a "Developer" edition was also offered that enabled VBA
Visual Basic for Applications
Visual Basic for Applications is an implementation of Microsoft's event-driven programming language Visual Basic 6 and its associated integrated development environment , which are built into most Microsoft Office applications...

 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
Microsoft Visual Studio
Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

.

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
Visual Studio Team System
Visual Studio Application Lifecycle Management is a collection of integrated software development tools developed by Microsoft. These tools include IDEs, source control, work items, collaboration, metrics, and reporting tools.-Platform:...

 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. With Visual Studio 2008, VSTO 3.0 is no longer available separately but is integrated with full functionality into Professional and Team System IDEs.

Comparison with VBA

Like VBA, code written for VSTO is executed by a separate virtual machine
Virtual machine
A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...

 (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 .NET assemblies
.NET assembly
In the .NET framework, an assembly is a compiled code library used for deployment, versioning, and security. There are two types: process assemblies and library assemblies . A process assembly represents a process that will use classes defined in library assemblies...

 which are associated with the documents by means of custom properties. 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. VSTO applications are subject to the .NET Framework Code Access Security
Code Access Security
Code Access Security , in the Microsoft .NET framework, is Microsoft's solution to prevent untrusted code from performing privileged actions. When the CLR loads an assembly it will obtain evidence for the assembly and use this to identify the code group that the assembly belongs to. A code group...

 constraints, in addition to the digital signature
Digital signature
A digital signature or digital signature scheme is a mathematical scheme for demonstrating the authenticity of a digital message or document. A valid digital signature gives a recipient reason to believe that the message was created by a known sender, and that it was not altered in transit...

 based permission model that governs VBA macros.

VSTO compatibility and add-in functionality

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) Office 2010 applications will always use VSTO 2010 Runtime. Design-time support is as follows:
VSTO/VSTO runtime version Develop/Build against Office 2003 Develop/Build against Office 2007 Develop/Build against Office 2010 .NET version
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

Available as
Document-level Application-level Document-level Application-level Document-level Application-level
VSTO 2003 Word, Excel .NET 1.1 Available only as Visual Studio .NET 2003 VSTO SKU
VSTO 2005 Word, Excel Outlook .NET 2.0, 3.0 or 3.5 Available as Visual Studio 2005 VSTO SKU and part of Visual Studio 2005 Team System editions
VSTO 2005 SE Requires VSTO 2005 for document-level customizations Word, Excel, Outlook, PowerPoint, Visio InfoPath Word, Excel, Outlook, PowerPoint, Visio, InfoPath .NET 2.0, 3.0 or 3.5 Downloadable for Visual Studio 2005 Professional and above, however document-level customizations require original VSTO 2005 (Standalone SKU or Team System editions)
VSTO 3.0 Word, Excel (Builds against the VSTO 2005/2005 SE runtime) Word, Excel, Outlook, PowerPoint, Visio, Project (Builds against the VSTO 2005 SE runtime) Word, Excel, InfoPath Word, Excel, Outlook, PowerPoint, Visio, InfoPath, Project, SharePoint 2007 Workflows .NET 3.5 Built into Visual Studio 2008 Professional and above
VSTO 4.0 Word, Excel Word, Excel, Outlook, PowerPoint, Visio, InfoPath, Project Word, Excel Word, Excel, Outlook, PowerPoint, Visio, InfoPath, Project .NET 3.5 or 4.0 Built into Visual Studio 2010 Professional and above


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 and Professional. VSTO 2005 SE solutions will work with all editions of Office 2007.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK