1 / 32

DEV261 2007 Office 客户端开发增强

DEV261 2007 Office 客户端开发增强. 课程内容概述.

alamea
Télécharger la présentation

DEV261 2007 Office 客户端开发增强

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DEV2612007Office客户端开发增强

  2. 课程内容概述 • 在Office 2007客户端众多新特性中,和使用者关系最为密切的应该是在UI方面的增强。例如,Office 2007摒弃了传统以计算机命令作为功能组织单位的菜单,而替换为以用户命令为组织单位的Ribbon,这使得用户可以根据当前正在操作的文档内容,快速定位到想要执行的操作。对于每一个信息工作者而言,UI增强将很大程度到提高我们编写文档的质量和效率,而对于每个开发人员而言,对于Office Client用户界面可扩展性的增强和包括Open XML这种开发存储格式的提供使得对于Office Client端的扩展和开发变得随心所欲。

  3. 课程内容安排 • 新一代的2007Office客户端增强 • 随心所欲操控新的OfficeOpenXML格式文档 • 扩展和定制2007Office客户端,包括VSTO3.0,扩展Ribbon,创建自定义任务面板等 • Microsoft2007OfficeSystem开发展望

  4. 微软Office一路走来

  5. 现在的用户界面遇到了什么瓶颈? • Menus and toolbars were designed for less full-featured programs • The feature set of Office has grown and stretched existing UI mechanisms to the limit • It’s harder to find functionality than it was a decade ago • “There must be a way to do this…” • “I don’t even know where to start looking.”

  6. 直观印象:下一代的2007Office到底是什么样子的?直观印象:下一代的2007Office到底是什么样子的?

  7. Ribbons 和Groups Giving users one central place for functionality • Ribbon • Replacement for menus and toolbars • Associated with a tabs and organized around specific scenarios or objects • Modeless UI designed for easy browsing • Group • Each ribbon is organized into several groups • Contains related controls: • Richer content than menus/toolbars • Buttons, galleries, dialog box content…

  8. 全新用户界面大观 • The “Ribbon” • Galleries • Live Preview • Contextual Tools • Quick Access Toolbar (“QAT”) • “Super Tooltips” • “KeyTips” and Keyboard Navigation • Streamlined Options • Context Menus • New File Menu

  9. 新的文件扩展名 docx dotx docm dotm pptx potx pptm potm xlsx xltx xlsm xltm

  10. 新的Office文档格式:OpenXML • Office变成了一个基于XML的文档格式 • 基于微软Office开发XML格式标准 • 应用到了Word, Excel和PowerPoint • Office保存为一个包含各个组成部分的压缩文件 • 文档的组成部分保存为清晰的、开放的XMLO格式 Word Document (ZIP file) Developers can read and modify Office documents without requiring Office or using the Office object models Document Properties Comments Document Content as WordML Developers can read specific parts of a Word or Excel file with a simple XML parser Custom-defined XML Images / Sounds / Video Developers can easily replace or remove parts of a document such as the styles, graphics or comments Embedded code / macros Charts Valuable for both client-side and server-side development

  11. 使用“ WinZip”来编辑MicrosoftWord文档 • 自己编写程序来创建一个MicrosoftWord文档

  12. 代码分析:WinFX Packaging API • Microsoft WinFX Software Development Kit (SDK) • System.IO.Packaging namespace • add document parts, • retrieve and update contents, • or create new relationships • Important Classes • Package, • PackagePart, • PackageRelationship

  13. System.IO.Packaging Windowsbase.dll

  14. 兼容性 • 旧有版本创建的Office文档(如Office2000,OfficeXP,Office2003)可以在2007Office中打开 • 仅仅安装了就有版本MicrosoftOffice的用户只需要安装一个扩展包,就可以直接打开、编辑2007Office创建的文档 • 2007Office客户端仍然可以把Office文档保存成以前的格式

  15. Office开发,VSTO才是王道 • Visual Studio Tools for the Microsoft Office System v3(VSTO3.0) • Highly streamlined developer experienceDocument-level Customizations • Microsoft Excel • Microsoft Word • Microsoft InfoPath • Application-level Add-ins

  16. VSTO Version 3.0 (early thinking) • O12-specifics : new features, file format, UI • App-level add-ins for most client programs • Deeper server side programming • Excel User-Defined Funcs (client/server) • Workflow & SharePoint support • Mobile device support VSTO 2005 • Custom ActionsPane • Host Controls on the document surface • Cached Data in the document • Server-side data processing • App-level add-ins for Outlook • Manifest-based deployment & update VSTO 2003 • Document-level code behind • Brings Office into the managed world • Strict security model VSTO Roadmap

  17. 更多的Office开发向导

  18. Bookmark XmlNode NamedRange ListObject ChartObject Host Controls • First class .NET object extending Office object model types • Inherits members of underlying object • Enhanced functionality • New events • Data binding support • Resolution of Event/Method Collisions • Tag field & Parameterized Property Fix for C# Bookmark XmlNode Range List Chart

  19. Windows Forms Controls • Use normal Windows controls in Word documents and Excel spreadsheets • Embedded in VSTO-defined ActiveX container

  20. 数据绑定 Databinding • Builds on ADO.NET • Program against data instead of Word and Excel object models • Bind multiple controls to same DataSet • Two types of binding • Simple (Binding a field to the property of a view control) • Complex (Binding multiple field values to a control) • Data sources include: • Web Service • Database • DataSet • Custom Object

  21. 创建一个VSTOWord2007项目,使用Hostcontrol和WindowsControl来进行数据绑定创建一个VSTOWord2007项目,使用Hostcontrol和WindowsControl来进行数据绑定

  22. 定制Office 2007 用户界面Scenarios • ISV with ERP solution can create application-wide ribbon extensions that allow users to access their information from within all Office 2007 products that support the new UX • Add your own tabs • Add your own groups to built-in tabs • Add to the File menu • Add to built-in contextual tabs • Repurpose built-in controls Custom Ribbon Extensions Core Tasks TaskPanes

  23. Ribbon ComponentsReview • Ribbon accessible via a tab • A Ribbon contains one or more groups • A group contains one or more controls • New controls: ToggleButtons, SplitButtons, EditBoxes, DropDowns, ComboBoxes, CheckBoxes, DropDownGrids

  24. ribbon tabs tab group control group control Ribbon XML FileArchitecture

  25. Document-Level Custom UISteps • Create ribbon XML file • Open Office 2007 zip package • Add ribbon XML file to zip package • Add new content type • Add new relationship • Package back again as Office 2007 document <Override PartName="/customui/customui.xml“ ContentType="application/xml"/> <Relationship Id="rId*“ Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customui/customui.xml"/>

  26. Action Handlers • Create procedure (VBA or .NET) • Hook it up with the control in the ribbon XML Sub YourActionHandlerProcedure(ByVal control As Variant) Your Code End Sub <button id="buttonGenerateRefNumber" label="Reference Number" size="large" onAction=“YourActionHandler"/>

  27. 给一个文档增加一个自定义Ribbon

  28. Specific Doc/Template Doc Parts Custom UI ActionHandlers Any Document Custom UI ActionHandlers Add-In 定制Office 2007 客户端的界面Your options • Document-level (static) • Include custom UI in the file package • Make action handlers available in Visual Basic for Applications (VBA) • Application-level (dynamic) • Load custom UI via add-in • Make action handlers available in add-in

  29. 定制任务面板(Task Panes)Scenarios • ISV creating a smart documentsolution for helping a sales personcreating a sales proposal • ISV creating a task pane that can be activated by the user in order for him to access the ISVspecific information (e.g. from a back-end financial LOB system) Custom Ribbon Extensions Core Tasks TaskPanes

  30. 创建一个文档级别的任务面板

  31. Content management Collaboration Portals Search Streamlined processes Business intelligence Word processing Business modeling Business data management Presentations InformationManagement Microsoft2007OfficeSystem开发展望 Slide 18: On the upper pie, change Office 12 to the updated logo. You can even put the Windows Sharepoint Services Logo in the center of the pie to get the point across. I do want to use this slide because this is how Bill has been talking about all the server capabilities. It’s not very different from 32, especially when you consider the story that Bill normally tells here.

More Related