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

Session 2: Office as a development platform with Visual Studio 2008

  • Upload
    ukdpe

  • View
    2.262

  • Download
    0

Embed Size (px)

DESCRIPTION

What's new in Smart Client Development Do you build rich client applications? If so, you'll want to make sure that you're aware of all Microsoft's client-development technology. This event will showcase a wealth of new and forthcoming technology, including Visual Studio 2008. Agenda: Session 1: Building Rich Clients on the Microsoft Platform - Martin Parry People want compelling user experiences supported by powerful online services. Microsoft's platform and tools empower developers to build both the rich client and the service. In this session we'll concentrate on some recent and forthcoming technologies that enable rich client apps: Visual Studio 2008, WPF, SQL Server Compact Edition and ClickOnce to name but a few. Session 2: Office as a development platform with Visual Studio 2008 - Daniel Moth The 2007 Microsoft Office System is extensible like never before. In this session we'll look at the numerous ways to extend the various Office applications such as Word, Excel, Outlook and others. Customisations demonstrated will include the new designers and templates for the Ribbon, Actions Pane, Task Pane, Content Controls and Form Regions. This will all be done in managed code from within Visual Studio 2008 and we will also see how to interop in both directions with VBA code. For more details and the original slidedeck visit http://www.microsoft.com/uk/msdn/events/new/Detail.aspx?id=115

Citation preview

Page 1: Session 2: Office as a development platform with Visual Studio 2008

Office as a development platform with Visual Studio 2008

Daniel MothDeveloper and Platform GroupMicrosofthttp://www.danielmoth.com/Blog

Page 2: Session 2: Office as a development platform with Visual Studio 2008

AGENDA

VSTO OverviewOffice Ribbon DesignerCustom Task PaneAction PaneOutlook Form Region DesignerWord Content ControlsVBA <-> VSTO interopClickOnce Deployment

Page 3: Session 2: Office as a development platform with Visual Studio 2008
Page 4: Session 2: Office as a development platform with Visual Studio 2008

Roadmap

Custom Document ActionsPane Host Controls on document surface Cached data in the document Server-side data processing Application-level add-ins for Outlook

20072003

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

20072003

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: Session 2: Office as a development platform with Visual Studio 2008

VSTO Functionality Over Time

•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: Session 2: Office as a development platform with Visual Studio 2008

Doc-Level Version Resilience

v1 solutions use the VSTO v1 runtimev2 solutions use the VSTO v2 runtimev3+ 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 FrameworkCommon VSTO/VSTA runtime

Page 7: Session 2: Office as a development platform with Visual Studio 2008

Set the scene inc document level addins

Page 8: Session 2: Office as a development platform with Visual Studio 2008

“Fluent” UI

Ribbon, Custom Task Panes, Actions Pane, Form Region

Page 9: Session 2: Office as a development platform with Visual Studio 2008

Office RibbonNew Look and Feel for Office UI

Replaces Command Bars in “the big 5” Office appsIntroduces a new extensibility model: RibbonXEnables you to

Customize office tabs, Add to built-in tabsRemove tabs, groups and controlsAdd to Office menu, Override built-in UI

Tab GroupControl

Ribb

on

Page 10: Session 2: Office as a development platform with Visual Studio 2008

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>

<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: Session 2: Office as a development platform with Visual Studio 2008

Ribbon Customization

Office built-in support for XML-based customization modelVSTO 2005 SE support

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

VSTO v3.0 (Visual Studio 2008) supportAdds full-blown visual designer support“Export to XML” optionA more robust programming layer inc. events

Page 12: Session 2: Office as a development platform with Visual Studio 2008

Ribbon Designer Property Grid

Ribbon Control Toolbox

Design Surface

Page 13: Session 2: Office as a development platform with Visual Studio 2008

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: Session 2: Office as a development platform with Visual Studio 2008

Pane UI Customization

Page 15: Session 2: Office as a development platform with Visual Studio 2008

Custom Task Panes and Action Panes

Page 16: Session 2: Office as a development platform with Visual Studio 2008

Document Actions

Task Pane

WinForms UserControl (ActionsPan

e)

ActionsPane Architecture

VSTO Invisible ActiveX Control

Page 17: Session 2: Office as a development platform with Visual Studio 2008

Outlook Form Region Features

New technology in Outlook 2007 for enhancing and replacing Outlook’s built-in formsCode behind form region is implemented as COM add-inNew controls provide built-in look & feel and data binding to Outlook data

Page 18: Session 2: Office as a development platform with Visual Studio 2008

4 Types of Form Regions

Adjoining and SeparateCustom and built-in forms

Replacement and Replace-allCustom forms only

Reading Pane can display all types except Separate

Page 19: Session 2: Office as a development platform with Visual Studio 2008

Adjoining in Reading Pane

Page 20: Session 2: Office as a development platform with Visual Studio 2008

Adjoining in Inspector

Page 21: Session 2: Office as a development platform with Visual Studio 2008

Separate

Page 22: Session 2: Office as a development platform with Visual Studio 2008

Replacement & Replace-All

Page 23: Session 2: Office as a development platform with Visual Studio 2008

VS2008 Outlook Form Regions

VSTO eases development of Outlook form regionsConfigure form region with a simple, intuitive wizardDebugging (F5), Intellisense

Import Use wizard to import Outlook-created OFS fileControls are referenced & cast to correct name & type

DesignDesigner supports WPF and Windows Form controlsProperties window exposes manifest

Page 24: Session 2: Office as a development platform with Visual Studio 2008

Outlook Form Region

Page 25: Session 2: Office as a development platform with Visual Studio 2008

Fluent UI

Page 26: Session 2: Office as a development platform with Visual Studio 2008

Word

Content Controls

Page 27: Session 2: Office as a development platform with Visual Studio 2008

Word Content Controls

New experience for developing structured documents in Word 2007New UI for developers to access Word Content ControlsProgrammable through Word Object ModelSupport for XML Mapping

Page 28: Session 2: Office as a development platform with Visual Studio 2008

Toolbox Support

Word content controls available in Toolbox Increases discoverability of content controlsDrag-and-drop experience

Page 29: Session 2: Office as a development platform with Visual Studio 2008

Property Grid Support

Easily access the properties and events of the content controls

Page 30: Session 2: Office as a development platform with Visual Studio 2008

Programming Paradigm

Windows Forms style programming modelGenerate event handlersSupport for IntelliSense

Page 31: Session 2: Office as a development platform with Visual Studio 2008

Word Content Controls

Page 32: Session 2: Office as a development platform with Visual Studio 2008

Two-Way Simple Data Binding

Two methods to data bindDrag and drop support from Data Sources windowSet up through the property grid

Page 33: Session 2: Office as a development platform with Visual Studio 2008

UI Feature Availability VSTO 2005 + VSTO 2005 SE VSTO 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 ControlsDrag n drop controlsSimple data-bindingLock controls and content

Page 34: Session 2: Office as a development platform with Visual Studio 2008

Where we’ve been, what’s left

VSTO OverviewOffice Ribbon DesignerCustom Task PaneAction PaneOutlook Form Region DesignerWord Content ControlsVBA <-> VSTO interopClickOnce Deployment

Page 35: Session 2: Office as a development platform with Visual Studio 2008

Call VSTO from VBA

You enable VBA via COM InteropInterop implemented at design timeYou can then call VSTO from VBA with IntelliSense after building the project

Page 36: Session 2: Office as a development platform with Visual Studio 2008

VBA and VSTO Interop

Page 37: Session 2: Office as a development platform with Visual Studio 2008

ClickOnce for Office Add-ins

Low-impact deployment mechanismSelf-containedSolutions installed per user

Prerequisites are installed if the user is an adminClickOnce support

Full end-to-end solution installationRicher version-independent security modelOffline access via the ClickOnce Cache

Page 38: Session 2: Office as a development platform with Visual Studio 2008

ClickOnce Deployment

Page 39: Session 2: Office as a development platform with Visual Studio 2008

Summary

The rationale for the VSTO architectureBring together Office and .NETProvide a sophisticated developer experienceProvide a solid baseline runtime infrastructure

Office is a true development platform

Page 41: Session 2: Office as a development platform with Visual Studio 2008

Resources

Visit the VSTO Developer Center http://msdn.microsoft.com/office/tool/vsto/default.aspx

VSTO Help documentation on MSDNhttp://msdn2.microsoft.com/en-gb/library/d2tx7z6d(vs.90).aspx

VSTO Forumhttp://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=16

VSTO Team Bloghttp://blogs.msdn.com/vsto2

Page 42: Session 2: Office as a development platform with Visual Studio 2008

VSTO Design-Time Stack

Visual Studio

Project Templates

IDE Hosting

Item Wizards

WorkflowDocument Solutions

Add-ins RibbonsForm

Regions

SharePoint

Excel, Word, Info Path Excel,

InfoPath, Outlook,

PowerPoint, Visio, Word,

Project

Excel, Outlook,

PowerPoint, Word

OutlookSeparate

IDE

Info Path

Page 43: Session 2: Office as a development platform with Visual Studio 2008

VSTO Runtime

VSTO/A Runtime StackOffice Client Host Managed/

Unmanaged Host

Doc Task Pane

Host Item

Controls

Win FormsControls

Doc-Level Solution App-Level Add-in

Custom Ribbon

Custom Task Pane

Custom Form

Region

App-LevelAdd-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: Session 2: Office as a development platform with Visual Studio 2008

© 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.