Developers have created applications for Microsoft Office for some time but with Microsoft Office 2003, Microsoft Office emerged as a first-class developer platform.
Before Microsoft Office 2003, Office development was limited to automating repetitive tasks through custom macros with Microsoft Visual Basic for Applications (VBA) and to building custom COM add-in solutions by using Microsoft Visual Studio 6.0 or Microsoft Visual C++. However, the Microsoft .NET Framework and the Microsoft Office primary interop assemblies enable you to build custom add-ins and smart client solutions by interacting with an Office application's COM-based object model using managed code. For more information, see Office Primary Interop Assemblies.
Complex and time-consuming, this early interoperability was limited to client-side development since Office automation is not supported for server-side scenarios. Microsoft Visual Studio Tools for Office, Version 2003 introduced new possibilities to Office Development. The 2007 Microsoft Office system release further expanded the variety of custom solutions that you can create. The 2007 release represents a true development platform that consists of applications, servers, services, and tools that together enable you to bridge the information gap between users and data in line-of-business (LOB) enterprise systems. Later releases of Visual Studio Tools for Microsoft Office continued to expand development opportunities. For more information, see What's New in Visual Studio Tools for Office.
The following table lists the features available to Microsoft Office developers according to each release of Visual Studio Tools for Microsoft Office, including the supported Microsoft Office applications
Table 1. Features by Visual Studio version
|
Version
|
Applies to
|
Features
|
|---|
|
Microsoft Visual Studio 2005 Tools for the Microsoft Office System
|
-
Microsoft Office Excel 2003
-
Microsoft Office Word 2003
-
Microsoft Office InfoPath 2003
-
Microsoft Office Outlook 2003
-
Visual Studio 2005
|
-
Custom document action pane
-
Hosted controls on document surface
-
Cached data in the document
-
Server-side data processing
|
|
Microsoft Visual Studio 2005 Tools Second Edition for the 2007 Microsoft Office System, Second Edition
|
-
2007 Office system
-
Office 2003
-
Visual Studio 2005
|
-
Application-level add-ins for most popular applications
-
Runtime support for key Fluent user interface (UI) elements in the 2007 Office release such as custom task panes, Ribbon, Outlook form regions.
-
Runtime support enabling Office 2003 document-level customizations to run in 2007 Office applications.
|
|
Microsoft Visual Studio Tools for the Microsoft Office system (3.0)
|
|
-
More pervasive application-level add-in and document-level solution support
-
Support features, file format, UI in the 2007 Office release.
-
ClickOnce deployment and security
-
Data binding for Word content controls
-
Interoperability between VBA and Visual Studio Tools for the Office system (3.0)
-
Custom workflow support for Microsoft SharePoint Products and Technologies.
-
Visual Office Fluent Ribbon designer for rapid application development.
-
Custom Outlook form region support.
-
Support for Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF) and Language Integrated Query (LINQ).
|
Office Business Applications are a new breed of applications that use the Microsoft Office system to find and surface LOB information. Office Business Applications help you extend Microsoft Office clients and servers into business processes running in LOB systems that support Enterprise Resource Planning (ERP), Customer Relationship Management (CRM), and Supply Chain Management (SCM). This enables enterprises to get new value from existing IT investments by combining them in innovative ways. For more information see, Getting Started with Office Business Applications (Part 1 of 2).
The 2007 release of Microsoft Office embraces open XML standards to enhance collaboration and interoperability across applications and organizations. With the adoption of open standards-based technology, Microsoft Office replaces the proprietary binary formats used in previous versions with an open, fully documented, royalty-free format that is based on industry XML and ZIP standards. The 2007 Office system also significantly improves productivity with the new Microsoft Office Fluent interface.
Server-side application development benefits from the use of the shared workspaces available in Microsoft Office SharePoint Server 2007. This helps information technology (IT) departments to collaborate over corporate boundaries. For more information on the different products and technologies that compose the 2007 Microsoft Office system, download the Microsoft Office Interactive Developer Map.
More than a wide variety of programs, server, services, tools, and technologies, the 2007 Microsoft Office system is a unified solutions platform for building Office Business Applications that makes LOB applications, enterprise data, and workflows accessible and relevant to users.
Visual Studio Tools for the Office system (3.0) provides a rich set of features with which to build and deploy customized Office Business Applications. It provides a set of workflow projects templates that help build collaborative solutions. The following section provides a high-level overview of key additions.
General Enhancements
As a fully integrated component of Visual Studio 2008, Visual Studio Tools for the Office system (3.0) offers wider support for application-level add-ins and document-level solutions in the 2003 Office release and the 2007 Office release. This gives you more flexibility in the types of projects you can develop as well as Microsoft Office applications to program against.
Figure 3. New project templates in Visual Studio 2008.
Another exciting feature within Visual Studio 2008 is the support for Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF) and Language Integrated Query (LINQ). This means that you can now build Microsoft Office solutions with improved graphical presentation and data visualization, more secure connections to custom services and build LINQ into applications where you may use SQL statements today. Custom Ribbon elements not only extend your applications, but keep your information workers in the context of an environment that is comfortable and familiar.
Figure 4. Custom task pane and Office Fluent Ribbon with formatted data
Visual Ribbon Designer
Using Visual Studio Tools for the Office system (3.0), you can create document-level customizations and application-level add-ins and customize the Office Fluent UI of the following applications:
-
Office Excel 2007
-
Office Outlook 2007
-
Office PowerPoint 2007
-
Office Word 2007
Figure 5. Office Fluent Ribbon UI Extensibility including groups and controls
Visual Studio 2008 provides a Visual Ribbon Designer that helps simplify the task extending the Office Fluent UI. You can drag and drop controls from the toolbar to the design surface and customize properties using the properties grid.
Figure 6. Visual Ribbon design surface with control toolbox and the property grid
Using the Visual Ribbon Designer, you can create groups, tabs, and commands using a design view. Follow the same approach you use to design Windows Forms applications using the controls that appear on the toolbox and the properties grid. You can then add event handlers to the control to build custom business logic into your customization. This simplifies extending the Office Fluent UI. You can:
-
Add new functionality to existing Office Fluent Ribbons by overriding or extending the existing UI
-
Customize existing tabs
-
Add to built-in tabs
-
Remove tabs, groups, and controls
Additionally, you can always access the code-behind to programmatically customize and extend the behavior of the Office Fluent Ribbon controls.
You can also use XML markup to customize the Office Fluent UI. Visual Studio Tools for the Office system (3.0) provides built-in support for XML-based customization model. It provides an Export to XML option that simplifies generating custom markup for the Office Fluent UI.
For more information, see the following videos:
Data Binding with Word 2007 Content Controls
Customizing document templates and connecting them to LOB data through data binding is a common business need. Imagine that you work for a sales company that needs to print large volumes of invoices and you must programmatically generate invoices based on data stored on a Microsoft SQL Server 2005 repository.
Content controls in Office Word 2007 provide an easy way to create blocks of content, such as combo boxes, that are more secure from accidental modification by end users. After you add content controls, you can use XML mapping to map content controls to data from custom XML to the document.
Figure 7. Sample sales invoice document template that uses content controls
You can add content controls and VBA code to map regions of a document template with LOB data stored in a custom xml file. For more information, see Building Word 2007 Document Templates Using Content Controls.
Visual Studio Tools for the Office system (3.0) provides a new option for developing structured documents in Word 2007. You can drag and drop Word 2007 content controls directly from the toolbox in Visual Studio. You can also access the properties and events of content controls using the property grid. Figure 8 shows the Word content controls toolbox, the property grid, and the data sources window.
Figure 8. Customizing Word 2007 content controls in Visual Studio 2008
Programmatic access to LOB data through Word object model support for XML mapping simplifies the programming paradigm. Visual Studio provides support for Microsoft IntelliSense for content control programming. The experience follows the Windows Forms programming model. You can generate event handling by double-clicking the controls.
Data binding is also simpler. You have two different options to map content controls to business data:
-
Drag and drop from Data Sources window. You can use the Data Sources view in Visual Studio 2008 to define the mapping between content controls and fields from a custom data source.
-
Set up through the property grid. You can use the property grid in Visual Studio 2008 to define the 1 to 1 mapping between a content control and a custom data source.
For more information see, Binding Data to Word 2007 Content Controls Using Visual Studio Tools for the Office System (3.0).
Custom Outlook Form Regions
More than a product to manage e-mail, calendar, contacts, and tasks, you can use Outlook 2007 as a presentation layer for custom applications. Solution developers frequently need to pull LOB data and expose approval forms that allow users to make decisions and interact with business processes. Instead of having the users to go to yet another system, you can use Outlook as an application UI.
Outlook 2007 introduced a new form technology called Outlook form regions, which you can use to replace the built-in forms. You can extend forms and add additional fields or controls in a variety of new ways. You can display forms on a Reading pane, use adjoining form regions, or separate form regions to extend the UI in Outlook 2007. To do this, you need to implement a COM add-in and write a form region manifest. For more information, see Building an Outlook 2007 Form Region with a Managed Add-In.
Figure 9. Custom forms region solution for interacting with LOB data
The Outlook Forms Designer in Visual Studio Tools for the Office system (3.0) simplifies implementing Outlook form regions. You can create custom solutions using four different types of form regions:
-
Adjoining and separate regions for custom message classes
-
Adjoining and separate regions for built-in forms
-
Replacement regions for custom message classes
-
Replace-all regions for custom message classes
Note: |
|---|
|
The Reading pane can display all types except separate.
|
Additionally, new controls enable data binding to Outlook data.
You can use a wizard to import Outlook-designed form regions. The wizard helps create controls and associates them with the correct name and types. Visual Studio Tools for the Office system (3.0) enables Windows Forms regions created by using the Windows Forms designer. This provides drag-and-drop functionality for controls from the toolbox and properties grid support.
Visual Studio Tools for the Office system (3.0) provides an enhanced programming model, form region manifest object, and automatic registration of add-in and form region. Code-behind form region is implemented as a COM add-in.
For more information, see Creating Outlook 2007 Form Regions Using Visual Studio Tools for the Office System (3.0).
Workflow Support and Support for SharePoint Products and Technologies
Using workflows, you can streamline business processes and route specific tasks to different actors and systems. Combined with software, enterprises can simplify and optimize workflows.
The Windows Workflow Foundation, Windows SharePoint Services 3.0, and Office SharePoint Server 2007 are designed to help create workflow solutions. You can use Microsoft Office SharePoint Designer and Microsoft Visual Studio 2005 to build custom workflow solutions. However, creating custom workflow solutions using these techniques are lengthy, error-prone, and limiting.
Visual Studio Tools for the Office system (3.0) supports the creation of SharePoint workflows to help manage business process and information flow. It reduces complexity and speeds development of SharePoint workflows.
Using Visual Studio Tools for the Office system (3.0), you can build either sequential or state-machine workflow solutions by:
-
Creating a custom workflow layout
-
Adding custom code to the workflow
-
Adding tasks to workflow
-
Adding custom forms to the workflow
One of the most important enhancements is the use of wizards to simplify creating and deploying workflow solutions. You can associate workflows with SharePoint libraries and focus on designing the actual workflow and the solution. Figure 10 shows the Start New Workflow wizard and the integration of custom workflows initiation with Microsoft Office.
Figure 10. Initiation of custom workflow solutions from Microsoft Office
For more information, see SharePoint Workflow Templates Solutions.
Interoperability with VBA
One of the biggest challenges for organizations is migrating existing VBA solutions to managed code. Existing Office solutions may benefit from the latest features and enhancements added to the latest versions. However, migrating solutions represents a big investment for companies.
One of the most significant enhancements that can impact organizations is the interoperability between VBA and Visual Studio Tools for the Office system (3.0).
This interoperability enables you to discover and call managed code from within VBA macros. It also helps preserve your investment in VBA by helping you to add new functionality to existing VBA applications. Supported in Word 2007 and Excel 2007, Visual Studio Tools for the Office system (3.0) enables incremental extension of VBA solutions by using Visual Basic or C#.
You can also enable VBA interoperability using COM interop at design-time. The support for Microsoft IntelliSense is another huge advantage. It works within the VBA editor and helps you discover and call managed code as shown in Figure 11.
Figure 11. Calling managed Visual Basic code from VBA
Note: |
|---|
|
Activating interoperability in a Microsoft Visual C# project is more complex.
|
For more information, see VBA Interoperability with Visual Studio Tools for the Office System (3.0).
Improved Deployment and Security by Using ClickOnce
Visual Studio Tools for the Office system (3.0) also introduces ClickOnce technology to Microsoft Office development. ClickOnce enables easy and efficient deployment of solutions.
When developing solutions using Visual Studio Tools for the Office system (3.0), you build a managed code assembly that is an application-level add in or a document-level customization such as a document template. In either of these cases, with ClickOnce, you can build and publish the set-up files locally, remotely, or to a CD to provide maximum flexibility. This new feature also deploys your customizations by default in full trust, so you do not have to configure applications with the Code Access Security Policy tool or other special security protocols. After deployment, each time the user invokes the add-in or solution, it automatically checks for updates to ensure the user always has the latest managed code assembly in their environment.
Figure 12. Publish wizard in Visual Studio 2008
For more information, see Deploying Solutions for the 2007 Office System with ClickOnce Using Visual Studio 2008 Professional.