+ All Categories
Home > Documents > OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Date post: 11-Jan-2016
Category:
Upload: paulina-moore
View: 216 times
Download: 0 times
Share this document with a friend
Popular Tags:
28
OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager
Transcript
Page 1: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

OFC302

Building Smart Document Solutions in Word & Excel

Martin SawickiLead Program Manager

Page 2: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Agenda

Demo: Smart Document in Action

What are Smart Documents?

Demo: XML Document Preparation

Demo: Deployment Manifest

Demo: Business Logic Code

Smart Document Security

Useful hints and troubleshooting

Goal: Learn how to make XML-powered Goal: Learn how to make XML-powered Smart Document solutions in Office 2003Smart Document solutions in Office 2003

Page 3: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Smart Document Smart Document in Actionin Action

Martin Sawicki

Lead Program Manager

Authoring & Collaboration Svcs.

demodemo

Page 4: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

What are Smart Documents?

The doc knows how to download the appropriate solution on-demandThe doc interacts with the user in a helpful mannerThe doc is aware of the user’s context and provides relevant assistanceThe doc understands the business process it is part of (where to go next)The doc can tell when its contents are not valid

This document is a Smart Document

Page 5: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Smart Document as a Deployment Mechanism

On-demand installation of solutionsNo need for code in the document or templateNo need to install manually on each user’s machine (also: auto update)Associates solution components with individual documents or classes of documents based on XML namespacesCan install schemas, XSLTs, Smart Document Task Pane code, SmartTags, COM-Addins, templates, etc

Page 6: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Smart Document as aSolutions Platform

Hide XML from the user, show user-friendly UI instead

Programmable, interactive, XML context-driven task pane in Word and Excel

COM (VB or C++) or .NET (VB.NET, C#)

Page 7: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Building Key Smart Document Components

DocumentDocumentor or

WorkbookWorkbook

XML SchemaXML Schema

Page 8: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

XML Document XML Document PreparationPreparation

Martin Sawicki

Lead Program Manager

Authoring & Collaboration Svcs.

demodemo

Page 9: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

“XML-ized” Document

To get started, you need:Customer defined XML Schema (XSD)

Word: Document marked up with XML from schema

Learn more: OFC291, OFC303, OFC308

Excel: Workbook with schema mappingsLearn more: OFC304, OFC305

Page 10: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Building Key Smart Document Components

DocumentDocumentor or

WorkbookWorkbookXML XML

Expansion Expansion Pack Pack

(Manifest)(Manifest)

XML SchemaXML Schema

Page 11: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Deployment ManifestDeployment Manifest

demodemo

Martin SawickiMartin SawickiLead Program ManagerLead Program ManagerAuthoring & Collaboration Svcs.Authoring & Collaboration Svcs.

Page 12: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

What is an XML Expansion Pack?(a.k.a. Manifest)

XML file describing components of solution and their locationAllows on-demand solution download and activationNo MSI or other setup packaging neededCentralized solution maintenance

Page 13: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Schema LibraryThe XML Namespace is very important

Schema Library = central registry on user’s computer keeping track of links between XML namespaces and…

XML schemas

XSLT transforms

Smart Doc solutions

XML NamespaceXML Namespace

Schema LibrarySchema Library

Schema files (XSD)Schema files (XSD)

XSLT TransformationsXSLT Transformations

Smart Doc SolutionsSmart Doc Solutions

Page 14: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Smart Documents and the Schema Library

XML Expansion Packs (manifests) are a way to set up the user’s schema library

(…Also, they are a way to write into other places in the registry, e.g. smart tags installation)

Page 15: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Building Key Smart Document Components

DocumentDocumentor or

WorkbookWorkbookXML XML

Expansion Expansion PackPack

(Manifest)(Manifest)

XML SchemaXML Schema

Other FilesOther Files

Compiled Compiled Task Pane Task Pane

LogicLogic

Page 16: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Smart Doc Flow Diagram

User opens documentUser opens document

Manifest-driven components Manifest-driven components download/installation/updatedownload/installation/update

Business logic initialization/Business logic initialization/Task pane descriptionTask pane description

User Interaction Loop/User Interaction Loop/Task pane refreshTask pane refresh

Page 17: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Business Logic CodeBusiness Logic Code

demodemo

Martin SawickiMartin SawickiLead Program ManagerLead Program ManagerAuthoring & Collaboration Svcs.Authoring & Collaboration Svcs.

Page 18: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Business Logic DetailsTask Pane Initialization

1. How many XML types supported by solution?

2. For each XML type:a. Describe it (caption, element name)

b. How many controls?

c. For each control:a. What is it? (Button? Checkbox? Radio group? Doc

fragment thumbnail? Help text? etc)

b. Specify initial contents

Page 19: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Business Logic DetailsTask Pane Refresh

1. Solution code called whenever:User’s XML selection context changes

User clicks control in task pane

2. For each XML type in current context:a. For each control:

a. Modify caption, value, state…

b. Modify contents

Page 20: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Smart Document SecurityXML Expansion Packs (Manifest files)

Policy-controllable settings

Manifest must be signed XML signing tool in Office SDKs

Manifest signature must be trusted

Manifest must be from trusted site

User warned before downloadand use of solution

Page 21: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Smart Document SecurityExecutable code

Downloadable code subject to Office security settings

DLL signing

.Net Assembly security

XSLTs must be signed to run script

Page 22: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Documentation

Smart Document SDKDetailed documentation

Samples

Tutorials

Schemas

Available soon after release of Office 2003

(beta versions available for the betas)

Page 23: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Useful Hints…Syntax of XML type name:

<namespace>#<tagname>

E.g: financial-report#Date

Special XML type names:To display task pane content when outside root element: #actionPertainsToEntireSchema

E.g: financial-schema#actionPertainsToEntireSchema

To display task pane content regardless of XML schema namespace:

http://schemas.microsoft.com/office/smartdocuments/2003#default

… and specify actionHandler as file type in the manifest (not solutionActionHandler)

Page 24: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

More Useful Hints…

When installed on user’s machine, smart document associations with XML namespaces are in the registry

[HKCU|HKLM]\Software\Microsoft\SchemaLibrary

The document’s reference to its XML expansion pack is stored in Custom Properties:

Solution ID – id of the solutionSolution URL – location of the manifest

Page 25: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Troubleshooting ManifestsMake sure the file paths in the manifest are correctMake sure the manifest is valid (manifest schema to be available in the SDK)Make sure the manifest is signed and the signature is trustedCheck you smart doc hasn’t been automatically disabled as a result of previous crashing (Word’s self-defense) under:

HKEY_CURRENT_USER\Software\Microsoft\Office\Common\SmartTag\Actions\<Smart Document class name> under Word (OpusApp) and XL (XLMain)

Values: Crash = 2, Enabled = 1, Disabled = 0

If managed, then make sure your managed key is 1 not 0 at

HKEY_CURRENT_USER\Software\Microsoft\Office\Common\SmartTag\Actions\<Smart Document Assembly class name>

Page 26: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

Community Resources

Community Resourceshttp://www.microsoft.com/communities/default.mspx

Most Valuable Professional (MVP)http://www.mvp.support.microsoft.com/

NewsgroupsConverse online with Microsoft Newsgroups, including Worldwidehttp://www.microsoft.com/communities/newsgroups/default.mspx

User GroupsMeet and learn with your peershttp://www.microsoft.com/communities/usergroups/default.mspx

Page 27: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

evaluationsevaluations

Page 28: OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.

© 2003 Microsoft Corporation. All rights reserved.© 2003 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.


Recommended