office as a development platform with visual studio...

44
Office as a development platform with Visual Studio 2008 Daniel Moth Developer and Platform Group Microsoft http://www.danielmoth.com/Blog

Upload: others

Post on 26-Jun-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Office as a development platform with Visual Studio 2008

Daniel Moth

Developer and Platform Group

Microsoft

http://www.danielmoth.com/Blog

Page 2: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

AGENDA

VSTO Overview

Office Ribbon Designer

Custom Task Pane

Action Pane

Outlook Form Region Designer

Word Content Controls

VBA <-> VSTO interop

ClickOnce Deployment

Page 3: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific
Page 4: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Roadmap

Custom Document ActionsPaneHost Controls on document surfaceCached data in the documentServer-side data processingApplication-level add-ins for Outlook

2007

2003

App-level add-ins for most popular Office appsRuntime support for key Office 2007 UI elements (Custom Taskpane, Ribbon, Outlook form regions)Runtime support enabling Office 2003 doc-level customizations to run in Office 2007

2007

2003

Workflow & Microsoft SharePoint supportOffice 2007 system-specific features, file format, UIApp-level add-ins for more client applicationsDeeper server-side programmingVSTO fully integrated into Visual Studio 2008

Page 5: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

VSTO Functionality Over Time

0

10

20

30

40

50

60

70

80

90

100

v1:2003 v2:2005 2005 SE v3:2007 vN:O14

Other

Server

Functional extensions

Infrastructure services

Deployment & Security

Add-ins

Doc-level

•Doc-level

•Outlook add-ins,

•VSTA in InfoPath

• functional extensions

• infra investments

•11 Office add-ins,

• infra investments

•SP Workflow,

•new designers,

• functional extensions

• infra investments

Page 6: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Doc-Level Version Resilience

v1 solutions use the VSTO v1 runtime

v2 solutions use the VSTO v2 runtime

v3+ solutions use the VSTO v3+ runtime

Reduces the number of runtimes (improves performance, working set)

Eliminates type name clashes in DefaultDomain

Based on the Managed Add-in Framework

Common VSTO/VSTA runtime

Page 7: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Set the scene inc document level addins

Page 8: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

“Fluent” UI

Ribbon,

Custom Task Panes, Actions Pane,

Form Region

Page 9: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Office Ribbon

New Look and Feel for Office UI

Replaces Command Bars in “the big 5” Office apps

Introduces a new extensibility model: RibbonX

Enables you to

Customize office tabs, Add to built-in tabs

Remove tabs, groups and controls

Add to Office menu, Override built-in UI

TabGroup

Control

Rib

bo

n

Page 10: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

XML-based Customisation SupportRibbon XML structure requires a

specific hierarchy

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnLoad">

<ribbon>

<tabs>

<tab idMso="TabAddIns">

<group id="MyGroup"

label="My Group">

<toggleButton id="toggleButton1"

size="large"

label="My Button"

screentip="My Button Screentip"

onAction="OnToggleButton1"

imageMso="AccessFormModalDialog" />

</group>

</tab>

</tabs>

</ribbon>

</customUI>

For example:

Page 11: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Ribbon Customization

Office built-in support for XML-based customization model

VSTO 2005 SE support

Simplifies hookup from .NET via pre-generated classes and sample XML

VSTO v3.0 (Visual Studio 2008) support

Adds full-blown visual designer support

“Export to XML” option

A more robust programming layer inc. events

Page 12: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Ribbon Designer Property Grid

Ribbon Control Toolbox

Design Surface

Page 13: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Custom Task & Actions Panes

VSTO simplifies and speeds up task pane UI design process with visual designers and .NET hookup

Actions Pane

– More robust, easier to program alternative to Office’s built-in “Smart Document” technology

Custom Task Pane

– The same general idea as Actions Pane, only on the application add-in level, not individual doc

Page 14: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Pane UI Customization

Actions Pane Custom Task Pane

Introduced VSTO 2005 / Office 2003 VSTO 2005 SE / 2007 Office

When to useWhenever task pane UI is specific to an individual document or template

Whenever task pane UI is specific to an application feature added by the add-in, regardless of document

AvailabilityWord document / templateExcel document / template

(both 2003 and 2007)

Word 2007 Add-InExcel 2007 Add-InPowerPoint 2007 Add-InOutlook 2007 Add-InInfoPath 2007 Add-In

Page 15: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Custom Task Panes and Action Panes

Page 16: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Document Actions

Task Pane

WinFormsUserControl

(ActionsPane)

ActionsPane Architecture

VSTO Invisible ActiveX Control

Page 17: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Outlook Form Region Features

New technology in Outlook 2007 for enhancing and replacing Outlook’s built-in forms

Code behind form region is implemented as COM add-in

New controls provide built-in look & feel and data binding to Outlook data

Page 18: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

4 Types of Form Regions

Adjoining and Separate

Custom and built-in forms

Replacement and Replace-all

Custom forms only

Reading Pane can display all types except Separate

Page 19: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Adjoining in Reading Pane

Page 20: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Adjoining in Inspector

Page 21: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Separate

Page 22: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Replacement & Replace-All

Page 23: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

VS2008 Outlook Form Regions

VSTO eases development of Outlook form regions

Configure form region with a simple, intuitive wizard

Debugging (F5), Intellisense

Import

Use wizard to import Outlook-created OFS file

Controls are referenced & cast to correct name & type

Design

Designer supports WPF and Windows Form controls

Properties window exposes manifest

Page 24: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Outlook Form Region

Page 25: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Fluent UI

Form RegionDocument- level Actions Pane

Ribbon UI Customization

App-level Custom Task Pane

Excel 2007

Word 2007

Outlook 2007

PowerPoint 2007

InfoPath 2007

Page 26: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Word

Content Controls

Page 27: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Word Content Controls

New experience for developing structured documents in Word 2007

New UI for developers to access Word Content Controls

Programmable through Word Object Model

Support for XML Mapping

Page 28: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Toolbox Support

Word content controls available in Toolbox

Increases discoverability of content controls

Drag-and-drop experience

Page 29: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Property Grid Support

Easily access the properties and events of the content controls

Page 30: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Programming Paradigm

Windows Forms style programming model

Generate event handlers

Support for IntelliSense

Page 31: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Word Content Controls

Page 32: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Two-Way Simple Data Binding

Two methods to data bind

Drag and drop support from Data Sources window

Set up through the property grid

Page 33: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

UI Feature Availability VSTO 2005 +

VSTO 2005 SEVSTO v3.0

Ribbon(2007 versions of Word, Excel, Outlook

and PowerPoint )

Simplified hookupSample XML

Simplified hookupSample XMLVisual designerRicher programming layerExport-to-XML option

Actions Pane(document-level projects only)

Word 2003 (doc, dot)Excel 2003 (xls, xlt)

Word 2003 (doc, dot)Excel 2003 (xls, xlt)Word 2007 (docx/m, dotx/m)Excel 2007 (xlsx/m, xltx/m)

Custom Task Pane(2007 versions of Word, Excel,

Outlook, InfoPath and PowerPoint)

Simplified hookupVisual designer

Simplified hookupVisual designer

Outlook Form Region(Outlook 2007 only)

Visual designerConfiguration wizardImport from existing

Word Content Controls

Drag n drop controlsSimple data-bindingLock controls and content

Page 34: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Where we’ve been, what’s left

VSTO Overview

Office Ribbon Designer

Custom Task Pane

Action Pane

Outlook Form Region Designer

Word Content Controls

VBA <-> VSTO interop

ClickOnce Deployment

Page 35: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Call VSTO from VBA

You enable VBA via COM Interop

Interop implemented at design time

You can then call VSTO from VBA with IntelliSense after building the project

Page 36: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

VBA and VSTO Interop

Page 37: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

ClickOnce for Office Add-ins

Low-impact deployment mechanism

Self-contained

Solutions installed per user

Prerequisites are installed if the user is an admin

ClickOnce support

Full end-to-end solution installation

Richer version-independent security model

Offline access via the ClickOnce Cache

Page 38: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

ClickOnce Deployment

Page 39: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

Summary

The rationale for the VSTO architecture

Bring together Office and .NET

Provide a sophisticated developer experience

Provide a solid baseline runtime infrastructure

Office is a true development platform

Page 40: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

MSDN in the UK

Visit http://msdn.co.uk

Newsletter

Events

Screencasts

Blogs

Page 42: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

VSTO Design-Time Stack

Visual Studio

Project Templates

IDE

Hosting

Item Wizards

WorkflowDocument

SolutionsAdd-ins Ribbons

Form

Regions

SharePoint

Excel, Word,

Info Path Excel,

InfoPath,

Outlook,

PowerPoint,

Visio, Word,

Project

Excel,

Outlook,

PowerPoint,

WordOutlook

Separate

IDE

Info Path

Page 43: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

VSTO Runtime

VSTO/A Runtime Stack

Office Client HostManaged/

Unmanaged Host

Doc

Task

Pane

Host

Item

Controls

Win Forms

Controls

Doc-Level Solution App-Level Add-in

Custom

Ribbon

Custom

Task Pane

Custom

Form

Region

App-Level

Add-in

VSTA

Integration

Common VSTO/A

Runtime

.NET CLRManaged Add-in

Framework (MAF)

AppDomain

Management

Deployment

and Updating

Security

Enforcement

Doc-Level

Solution

ClickOnce

Page 44: Office as a development platform with Visual Studio 2008download.microsoft.com/documents/uk/msdn/events/... · Workflow & Microsoft SharePoint support Office 2007 system-specific

© 2007 Microsoft Ltd. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market

conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.