Presentation is loading. Please wait.

Presentation is loading. Please wait.

New Capabilities with the Open XML File Format Visual Studio Tools for Office Mike Ormond Developer and Platform Group, Microsoft Ltd

Similar presentations


Presentation on theme: "New Capabilities with the Open XML File Format Visual Studio Tools for Office Mike Ormond Developer and Platform Group, Microsoft Ltd"— Presentation transcript:

1 New Capabilities with the Open XML File Format Visual Studio Tools for Office Mike Ormond Developer and Platform Group, Microsoft Ltd mike.ormond@microsoft.com http://blogs.msdn.com/mikeormond

2 Agenda Introduction to the file formats Solution development The document information panel Structured solutions with Word Dynamic documents Server document generation Visual Studio Tools for Office

3 OPEN XML FILE FORMATS Introduction to the new Open XML File Formats (OR: What does this thing look like anyway?)

4 Evolution Of File Formats Office 2000 Early Innovation XML document properties Office 97 Existing binary file formats designed in 1994, launched in Office 97 Office XP First XML Format Spreadsheet XML Office 2003 Breakthrough XML Support WordML, SpreadsheetML Custom-defined schema Office 2007 New XML Formats XML file format default XML PowerPoint format “Wave 12”

5 The Role Of XML With Documents ScenarioExample Document Assembly Server-based or user-assisted construction of documents from archived content or database content Create sales reports from financial and forecast data stored in a CRM system Content Reuse Much easier to move content between documents, including different document types Apply content stored in Word documents to Web pages quickly and efficiently Content Tagging Add domain-specific metadata to document content to enable custom solutions Tag presentations using a specific taxonomy to improve knowledge management efficiency Document Interrogation Query document repositories based on custom data, content types or document metadata Search for all documents containing a specific company name or sales contact Document Sanitization Remove unwanted content like comments or embedded code from your document when appropriate Remove all tracked changes and comments from a Word document before it is published

6 Open XML File Formats Default file format More efficient storage Program against full document contents Backward compatibility & legacy support Easy document assembly, conversion & integration Submitted to ECMA for standardization

7 Open XML Formats Architecture User view: single Office “file” Questionnaire. docx Developer view: modular file Document Parts Most parts are XML Each XML part is a discreet, compressed component Can add, extract and modify individual parts without using Office programs Corruption or absence of any part would not prohibit the file from being opened

8 Open XML File Formats

9 SOLUTION DEVELOPMENT Solution development with the new Open XML File Formats (OR: Great. Now do I make use of this from code?)

10 Tools for Accessing Data In Office Open XML files XML Editing Notepad? System.XML makes this easier ZIP Manipulation Compressed Folders in Windows? Third-Party Zip Libraries Microsoft’s Packaging API’s Office Open XML Resource Kit Code Snippets - Beta 2 C# and VB.NET Validation Library Parses a file and reports on schema, relationship errors and warnings Serialization/Deserialization Library Flattens package into a single file for ease of development in simple construction scenarios

11 System.IO.Packaging Part of.NET Fx 3.0 Allows you to Create / Open packages Create and delete parts and relationships Read and write part streams Iterate through collections of parts and relationships PackagePackagePartCollection └ PackagePart └ PackagePartPackageRelationshipCollection └ PackageRelationship └ PackageRelationshipPackUriHelper

12 System.IO.Packaging.Package Package class provides methods to create, enumerate and delete the following entities Package Package Relationships PackagePropertiesParts Core Properties Common Package Parts Thumbnail Digital Signatures officeDocument XML Part Specific Format Parts Etc… Part Rels XML Part Part Rels

13 System.IO.Packaging.Relationship Relationships tie the parts together Required to find parts (part names are not guaranteed) Iterate through RelationshipCollection by Type or ID Relationship Properties IDPackageRelationshipTypeSourceUriTargetModeTargetUri Package Relationships Core Properties Common Package Parts Thumbnail Digital Signatures officeDocument XML Part Specific Format Parts Etc… Part Rels XML Part Part Rels officeDocument XML Part

14 System.IO.Packaging.PackagePart Parts are the objects of data within the Package PackagePart provides support to create, enumerate and delete part relationships Get Part data as Stream PackagePart Properties: CompressionOptionContentTypePackageUri Package Relationships Core Properties Common Package Parts Thumbnail Digital Signatures officeDocument XML Part Specific Format Parts Etc… Part Rels XML Part Part Rels - The Quick Brown Fox jumped over the river. … XML Part - The Cow jumped over the moon. …

15 System.IO.Packaging.PackURIHelper Helper class to aid working with URIs URIs required to GetParts Create or Get URIs for PackagesParts Relationship parts Resolve relative URIs for parts from source to target part

16 Document Interrogation Scenarios When you need meta-data about Office files on a server Building reports from data in files Workflow and Content Management scenarios Validate compliance

17 Document Assembly Scenarios Useful when documents need to be generated from structured data Auto generate reports in Excel from data in database Create documents for users from form data Repurpose existing data (slide libraries) Recommendation: Start from a template

18 Document Sanitization Scenarios Security Remove active content (VBA, ActiveX) Privacy Remove comments, revisions, hidden text Remove or alter document properties Legal Insert copyrights, watermarks, images Run as part of Workflows, publishing, compliance scenarios

19 Solution Development

20 THE DOCUMENT INFORMATION PANEL Creating smart forms and dynamic documents (OR: How to leverage the power of InfoPath in your documents. You do know what InfoPath is don’t you?)

21 Document Information Panel Customisable form displayed in the client application Allows users to enter document properties (metadata) while working on the document SharePoint properties appear as metadata in the DIP

22 Custom Information Panel The Document Information Panel uses InfoPath technology This technology can be used to create business logic around any custom XML data All the power of InfoPath in Word Data connections, declarative rules engine, etc.

23 Document Info Panel

24 EXERCISING CONTROL Structured solution authoring with Word 2007 – Rich UI and robust editing behaviour. (OR: How to author multi-use and dynamic documents to make everyone’s life easier)

25 The Role Of XML Reference and custom-defined schemas Custom-defined Schemas Data-oriented (e.g., Price, Invoice) Represents the business information stored in the document Enable System Integration XML Reference Schemas Display-oriented (e.g. Bold, Italics, Tables, Paragraphs, Styles) Open Document Format Enable Archival & File Formats Interoperability

26 The Role Of XML Reference and custom-defined schemas XML Reference Schemas Display-oriented (e.g. Bold, Italics, Tables, Paragraphs, Styles) Open Document Format Enable Archival & File Formats Interoperability <w:p> John Doe John Doe Health Agency Health Agency </w:p>

27 3/24/2004 Health Agency 100 25% … Custom-defined Schemas Data-oriented (e.g., Price, Invoice) Represents the business information stored in the document Enable System Integration The Role Of XML Reference and custom-defined schemas

28 Content Controls (Word) Makes structured documents more robust & much less Word specific code needed Content restrictions, grouping & locking Code can be used for business logic! End user friendly and layout independent exposure of structured content No XML schema required Evolution of customer-defined XML with custom XML mapping capabilities (more detail in CD 305)

29 Solutions And Building Blocks Select and reuse any selection of WordprocessingML Building blocks and content controls Two steps to a document assembly solution Write 18 lines of UI code Make a few selections and clicks or attach a building block part

30 Content Controls

31 MAKING DOCUMENTS WORK FOR YOU Content Controls + Custom XML Store = Rich, Robust, Dynamic documents

32 Office XML Data Store Customer-defined XML (incl. WSS/Office properties) stored separately from WordprocessingML as a part in Open XML format Any XML can be stored (with or without XML schema) XML data is available as an editable tree (using familiar DOM) within Word Can be populated on a server using WinFX or a client using Word OM

33 XML Mapping Link content controls to nodes in the XML data store Provides for true data/view separation model in Word Mappings are created using standard XPath expressions Mappings can be set up to ‘auto-attach’ to incoming data Out of the box support for mapping to Office properties

34 Health Agency 100 … Content Controls + Custom XML

35 Dynamic Documents

36 WHAT ABOUT THE SERVER Generating Office Documents on the Server

37 Putting it all together Start with a Template Document Assembly System.IO.Packaging Delete / Create Parts & Relationships Document Manipulation System.IO.Packaging Word -> Content Controls + Custom XML Excel -> System.Xml + SpreadsheetML PowerPoint -> System.Xml + PresentationML

38 Document Assembly On the Server

39 VISUAL STUDIO TOOLS FOR OFFICE

40 Visual Studio Tools For Office Tool for building managed applications targeting Office 2003 / Office 2007 The managed code API for Office Generates a lot of the “plumbing” code Visual designers Separate date & presentation Robust run-time Flavours VSTO 2005, VSTO 2005 SE, VSTO V3 (Orcas)...

41 VSTO Editions VSTO Version Office 2003Office 2007 Additional Information docappdocapp 2003 Excel InfoPath Word Visual Studio.NET 2003 2005 Excel InfoPath Word Outlook Data Caching Server-Side Programming Data Caching Server-Side Programming Integrated Designer Smart Tags ActionsPane Smart Tags ActionsPane 2005 SE Excel Outlook PowerP oint Visio Word InfoPath Excel InfoPath Outlook PowerP oint Visio Word Rbbon Customization Custom TaskPanes Outlook Form Regions Compatibility "V3" Excel Word Excel InfoPath Word All Ribbon Customization Custom TaskPanes Outlook Form Regions Ribbon Customization Custom TaskPanes Outlook Form Regions New Security Model ClickOnce Deployment AppDomain Isolation Runtime Standardization From Wouter van Vugt (http://blogs.infosupport.com/wouterv)http://blogs.infosupport.com/wouterv

42 Visual Studio Tools for Office

43 Additional Resources Open XML File Formats http://www.openxmldeveloper.ordg http://blogs.msdn.com/brian_jones General http://msdn.microsoft.com/office http://blogs.msdn.com/dmahugh http://blogs.msdn.com/erikaehrli VSTO / Programmability http://msdn.microsoft.com/office/tool/vsto http://www.officezealot.com/vsto http://blogs.msdn.com/kevinboske http://blogs.msdn.com/eric_carter

44 Additional Information UK MSDN Events Post events page including slide decks http://www.microsoft.com/uk/msdnevents Upcoming events http://www.microsoft.com/uk/msdn/events/upcoming.aspx UK MSDN Site & Flash Newsletter Local news, events, nuggets & webcasts http://www.microsoft.com/uk/msdn Register to receive the bi-weekly MSDN Flash by email http://www.microsoft.com/uk/msdn/flash.aspx

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


Download ppt "New Capabilities with the Open XML File Format Visual Studio Tools for Office Mike Ormond Developer and Platform Group, Microsoft Ltd"

Similar presentations


Ads by Google