Using the Actions Pane, Host Controls, and Smart Tags

Slides:



Advertisements
Similar presentations
VSTO Day ActionsPane e la gestione dei dati Gianluca Ciocci
Advertisements

Overview of Visual Studio 2005 Tools for the Microsoft Office System Svetlana Loksh Development Lead Visual Studio Tools for Office Team Microsoft Corporation.
Office 2010 UI Customization Office 2010 Client. Outline Office and Visual Studio 2010 Office UI Customizations Custom Task Panes Outlook Form Regions.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
 2002 Prentice Hall. All rights reserved. Chapter 2 - Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Overview of the Visual Studio.NET.
Windows Forms in Visual Studio 2005: An in-depth look at key features Name: Mike Henderlight Title: Program Manager.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
It’s always better live. MSDN Events Developer Productivity Improvements with Visual Studio 2008 and Office Business Applications.
Windows Forms in Visual Studio 2005: An Overview Saurabh Pant Program Manager Microsoft Corporation.
Today’s Agenda 14:30 Communication & Collaboration Platform 14:50 Portals & Document Management 15:10 Enterprise Project Management 15:30 Break 15:50 Business.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.
OFC 322 Building Office Research Web Services: Exposing Corporate Data Through Office Brian Jones Program Manager Authoring Services Martin Sawicki Lead.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
Future Directions: Building Customizable Applications using.NET Eric Schnepp TLN205 Lead Program Manager Microsoft Corporation.
Microsoft Confidential Office as a Development Platform Tim Heuer
Microsoft ®.NET and Microsoft ® Office 2003 Suthep Sangvirotjanaphat [MVP]
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
WEB 304 An Overview of ASP.NET and Windows Workflow Foundation Kashif Alam Program Manager Developer Division Microsoft Corporation.
Building Data Visualization Solutions with Visio 2007 Paul Holdaway Microsoft Consulting Services (UK)
OFC335 Microsoft Office Word 2007 XML Programmability: True Data/View Separation and Rich Eventing for Custom XML Tristan Davis Program Manager Microsoft.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Windows Forms in Visual Studio 2005: An Overview Name: Joe Stegman Title: Lead Program Manager Session code.
OFC 307 Office 2003 Solution Case Studies Ray Stephenson Smart Client Technical Evangelist
Slide 1.NET Development for Project 2003 Samples from the Project 2003 SDK Jim Corbin Programmer Writer Office Developer Documentation Microsoft Corporation.
Microsoft Office System UK Developers Conference Radisson Edwardian, Heathrow 29 th & 30 th June 2005.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Microsoft Dynamics NAV 2009 and Architecture Overview Name Title Microsoft Corporation.
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
The 2007 Microsoft Office System: Developer Model for the New User Interface Andy Cheung ISV Developer Evangelist Microsoft Hong Kong.
Smart Client Development Using Visual Studio Tools for Office and Windows Mobile Todd Apley Software Design Eng/Test Lead
Making the Most of WinForms 2.0 Data Binding Rajiv Sodhi Microsoft India.
ADD-IN EXPRESS World-class Office extensions with little coding.
Windows Forms in Visual Studio 2005: An in-depth look at key features Name: Joe Stegman Title: Lead Program Manager Session code.
Extending the 2007 Microsoft Office System User Interface Mike Taulty Developer & Platform Group, Microsoft Ltd
Microsoft Visual Studio 2005 Tools for the Office System: Building Office Solutions Using Visual Studio 2005 Tools for Office Andrew Coates Developer Evangelist.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Arun Prakash Ganesan Development Lead Microsoft Corporation Office 2007 for Developers.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
The 2007 Microsoft Office System Client-side Development User Interface & Outlook OM Martin Parry Developer and Platform Group, Microsoft Ltd
Overview of Visual Studio 2005 Tools for the Microsoft Office System Mike Hernandez Program Manager Visual Studio Tools for Office Team Microsoft Corporation.
DEV221 Windows Forms in Visual Studio 2005: An Overview Saurabh Pant Program Manager Microsoft Corporation.
Office 12: Developing With The Programmable Customization Model For The Office 12 User Experience (Part 2) also known as… Savraj Dhanjal OFF302 Program.
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
BizTalk Damir Dobric Lead Architect. Agenda Microsoft BizTalk RFID Overview Architecture Application models Implementing Event Handlers Sensors.
Using Data in Microsoft Visual Studio 2005 Tools for the Microsoft Office System Mike Hernandez Product Manager Visual Studio Tools for Office.
Office 365 Development July 2014.
Mike Harsh PRSL001 Program Manager Microsoft Corporation
1/10/2018 9:33 PM Cloud Roadshow © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO.
5/20/2018 2:53 AM © 2006 Microsoft Corporation. All rights reserved.
Microsoft Build /9/2018 8:04 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Office 2010 UI Customization
Visual Studio Tools for Office 2005
What’s New in the Lync Client SDK 9/8/2018 8:15 AM
Managed Code, Data and Microsoft Office
MGB 2003 Adam Calderon – C# MVP Principal Engineer Interknowlogy
Understand Windows Forms Applications and Console-based Applications
Reaching more customers with accessible Metro style apps using HTML5
Overview of Visual Studio 2005 Tools for the Microsoft Office System
Office as a development platform with Visual Studio 2008
Visual Studio 2005 Tools For Office: Creating A Multi-tier Application
Microsoft Office System UK Developers Conference
Programming with Microsoft Visual Basic 2008 Fourth Edition
Windows Forms in Visual Studio 2005: An in-depth look at key features
Windows Forms in Visual Studio 2005: An Overview
Contexualized Data In Document Authoring
Presentation transcript:

Using the Actions Pane, Host Controls, and Smart Tags Donald Drake Development Manager Visual Studio Tools for Office

Agenda Actions Pane Host Controls Dynamic Controls Smart Tags Overview Managing Control Layout Host Controls Excel Host Controls Word Host Controls Dynamic Controls Smart Tags

Actions Pane Overview Enables contextual UI complementary to the document Flexible way of designing custom UI Addresses UI layout challenges Plugs naturally into Office UI Acts like a toolbar: floating or docked

Actions Pane Technology Overview Smart Document SDK Actions Panes (VSTO) Requires ISmartDocument interface implementation Not required. VSTO takes care of this implementation for you Requires XML expansion packs Not required. VSTO takes care of this for you Requires XML-based document Optional. You can create a solution that is not based on XML Supports ActiveX controls Supports Windows Forms controls

Adding an Actions Pane Actions pane becomes visible when you add a control to it Use Windows Forms controls, custom User controls or Actions Pane controls Actions Pane control gives a nice design-time experience Globals.ThisWorkbook.ActionsPane.Controls.Add (New DateTimePicker)

Create a Simple Actions Pane

Managing Layout Add multiple controls to the actions pane Change the stack order of controls on the actions pane when the user changes the orientation of the actions pane Programmatically change the orientation of the actions pane Show and hide controls on the actions pane Show and hide the actions pane

Managing Control Layout

Agenda Actions Pane Host Controls Smart Tags Overview Managing Control Layout Host Controls Excel Host Controls Word Host Controls Dynamic Controls Smart Tags

What is a Host Control? A type that extends the host application (Word or Excel) Object Model to provide new functionality or to enhance programmability.

Host Control Features Extends Office object model Properties and methods Richer event model WinForms style data binding Simplifies programming model

Automating Excel without Host Controls

Agenda Actions Pane Host Controls Smart Tags Overview Managing Control Layout Host Controls Excel Host Controls Word Host Controls Dynamic Controls Smart Tags

Host Controls in Excel Chart ListObject NamedRange XMLMappedRange

Creating Excel Host Controls Drag and drop host control from Visual Studio Toolbox Drag and drop a data element from the Data Sources window that is mapped to a host control Use menus to add the underlying Excel object to a document. The VSTO designer creates a host control to wrap the Excel object being created. XMLMappedRange controls Use the XML Source task pane

Using Excel Host Controls

Agenda Actions Pane Host Controls Smart Tags Overview Managing Control Layout Host Controls Excel Host Controls Word Host Controls Dynamic Controls Smart Tags

Host Controls in Word Bookmark XMLNode

Creating Word Host Controls Bookmark controls Drag/drop from Toolbox Drag/drop from Data Sources window Click Bookmark on the Insert menu XMLNode controls Use the XML Structure task pane

Using Bookmark Host Controls

Agenda Actions Pane Host Controls Smart Tags Overview Managing Control Layout Host Controls Excel Host Controls Word Host Controls Dynamic Controls Smart Tags

Dynamic Controls A control (managed or host control) added to the Word or Excel document at runtime Enable you to create interactive documents because you can add controls in response to user input or events

Managing Dynamic Controls Controls collection references static and dynamic controls Create dynamic controls with methods of the Controls collection Managed controls: AddButton, AddTextBox Host controls: AddBookmark, AddListObject, AddNamedRange You cannot dynamically create XMLNode or XMLMappedRanges controls You can only remove dynamic controls (not static) from the Controls collection at runtime

Dynamic Controls and Persistence Dynamic controls are not persisted Underlying data in dynamic host controls may be persisted. For example: If you remove an Excel NamedRange control, the data in the cells remains If you delete a Bookmark control, the contents of the bookmark remains

Dynamic Host Controls

Agenda Actions Pane Host Controls Smart Tags Overview Managing Control Layout Host Controls Excel Host Controls Word Host Controls Dynamic Controls Smart Tags

SmartTags Overview What is a SmartTag? What makes up a SmartTag? Context Based Actions What makes up a SmartTag? Recognized Text Actions

Developing VSTO SmartTags Steps: Create a SmartTag instance Add strings to recognize Add actions Register SmartTag object with the document

Create a SmartTag Instance Create a SmartTag object Excel: Microsoft.Office.Tools.Excel.SmartTag Word: Microsoft.Office.Tools.Word.SmartTag Stores Recognizers Terms Collection Property Expressions Collection Property Stores Actions Actions Array Property

Create a SmartTag Instance Constructor Parameters SmartTag type Caption SmartTag myTag = new SmartTag ("www.example.com#prodInfo", "Product Info");

Add Strings to Recognize Terms Collection Static strings Expressions Collection Regular expressions myTag.Terms.Add(“Tofu”); myTag.Expressions.Add (new Regex(“[A-Z]{1}[0-9]{3}”));

Add Actions Create Action objects Set Caption property Excel: Microsoft.Office.Tools.Excel.Action Word: Microsoft.Office.Tools.Word.Action Set Caption property Action action1 = new Action("Reorder"); myTag.Actions = new Action[] {action1} ;

Add Action Click Event Create Click event for action action1.Click += new ActionClickEventHandler(action1_Click); void action1_Click(object sender, Microsoft.Office.Tools.Excel. ActionEventArgs e) { // TODO: Add Event Handler Code }

Register SmartTag with Document VstoSmartTagsCollection Excel: ThisWorkbook class Word: ThisDocument class // In ThisWorkbook.cs this.VstoSmartTags.Add(myTag);

Smart Tags

Summary Create actions pane with one line of code Manage actions pane control layout Host Controls give you the ability to rapidly develop powerful VSTO applications by providing: Simplified programming model Rich event model Winforms style Databinding Add controls to documents either at design time or run time Use SmartTags to augment your UI based on document content

Next Steps Participate in our newsgroups and web forum microsoft.public.vsnet.vstools.office microsoft.public.officedev microsoft.public.office.developer http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=16 Participate in VSTO-related blogs Team blog: http://blogs.msdn.com/vsto2 VSTO MVP Chris Kunicki’s blog: http://www.officezealot.com/VSTO/ Attend a free chat or webcast http://www.microsoft.com/communities/default.mspx

For More Information Visit the VSTO sections of these MSDN® Developer Centers Office Developer Center http://msdn.microsoft.com/office/understanding/vsto/default.aspx Smart Client Developer Center http://msdn.microsoft.com/smartclient/understanding/vsto/default.aspx VSTO Help documentation on MSDN http://msdn2.microsoft.com/library/d2tx7z6d(en-us,vs.80).aspx

Questions?

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Why extend Office OM? To utilize the power of Word and Excel, we need to present most of the data in the document, not in Winform controls Word and Excel Object Models expose types for this purpose But the types exposed lack some features that .NET developers take for granted in Winforms

XMLMappedRange Host Control Mapping cells in an Excel worksheet to an XML Schema is a feature provided by Excel. When you map an Excel worksheet to XML, VSTO creates instances of XMLMappedRange host controls for each mapped cell Almost same as the NamedRange Host Control. Provides you direct programmatic access to the Range that is mapped to XML.

Adding Bookmark at Run Time private void bookmarkExample() { Microsoft.Office.Tools.Word.Bookmark bookmark1 = this.Controls.AddBookmark( this.Paragraphs[1].Range, “bookmark1”); bookmark1.Text = “Sample bookmark text.”; }

Outlook Solutions Add custom menu with buttons to standard menu bar Display custom forms Add custom controls to custom forms

Outlook Task Add-in Solution