Related Technologies [Word 2003 XML Reference] --  Microsoft Office Word 2003 XML Software Development Kit

Related Technologies [Word 2003 XML Reference]

The power of smart documents depends upon XML markup in Microsoft© Office Word 2003 documents. You can apply smart tags to XML elements just as you can apply to other content in a Word document. This topic presents brief introductions to these two technologies. For more information, see the Microsoft Office 2003 Smart Document Software Development Kit (SDK) and the Microsoft Office 2003 Smart Tag SDK, both of which are available online for download and in the MSDN© Library. Information about two other technologies, the ability to insert any or all of any XML file into a Office Word 2003 document and document protection, both new to Office Word 2003, are also discussed.

Smart Documents

What is a smart document?

Smart documents are documents that are programmed to determine what users need to do and to give those users help along the way. Smart documents are useful for documents that follow a specified process, such as an expense report, or that people use for specific content-creation tasks, such as writing a legal brief.

Smart documents are also flexible in terms of technology. Smart document dynamic-link library (DLL) files can be written in Microsoft Visual Basic® version 6.0, Microsoft Visual Basic .NET, C#, Microsoft Visual C++® version 6.0, Microsoft Visual C++® .NET, or any programming language designed for the Microsoft .NET Framework. You can even use the Microsoft Office Smart Tag List (MOSTL) Schema to create a smart document that uses XML to define the controls.

Because smart documents are designed for use within Office Word 2003 and Microsoft Office Excel 2003, you can incorporate the features built into the applications into your smart documents. For example, you could create a form in Word that uses range protection to specify who has permission to modify certain sections of the form. The employee review form described below would be a great example of using this feature. You can include add-ins that can be used with a document or template, as well as macros that are inside the smart document itself.

In addition, smart documents can interact with a variety of databases, such as those created by using Microsoft SQL Server™ and Microsoft Office Access 2003, and they can use Microsoft BizTalk® Server for tracking workflow. They can even interact with other Microsoft Office 2003 applications; for example, they can send e-mail through Microsoft Office Outlook® 2003 or create presentations in Microsoft Office PowerPoint® 2003, as well as other client-side applications.

You can deploy smart documents over a corporate network, an intranet, the Internet, through Web services, and through Web sites based on Microsoft Windows® SharePoint™ Services and Microsoft Office SharePoint Portal Server 2003. For more information, see Microsoft Office 2003 Smart Document Software Development Kit (SDK).

Examples of smart documents

Following is a list of some of the types of documents that can be turned into smart documents.

  • Expense reports. When an employee fills out an expense report, the report may need to be routed for approval before the accounting department reimburses the expense. A smart document developer could create a smart document for Excel that assists the user with filling out the expense report and then tracks the approval process. The smart document is programmed to ensure that all necessary information is entered into the expense report before it displays a button that allows the user to submit the expense report for approval. The smart document can access information in an employee database that specifies who must approve the document, and then the smart document can route itself to the appropriate people. After the expense report has been approved, the smart document submits itself to accounting. All of the logic is contained in the smart document and its supporting files, so that the expense report "knows" at any time whether it is completed, approved, or perhaps even paid.
  • Employee review forms. Many companies, both large and small, have a formal employee review process that involves completing at least one form. An employee review form that is a smart document can facilitate that review process. As a smart document, the employee review form "knows" who the employee and the reviewing manager are, and it can populate the form with that information. The smart document can provide assistance or links to assistance as the employee completes each section of the form, and it can know when each section is completed and can display a Submit button when the employee has finished. When the employee clicks the Submit button, the form routes itself to the reviewing manager, and the process of completing the appropriate sections is repeated. When both employee and reviewer have signed off and the process has been completed, the form can electronically file itself.
  • Legal briefs and contracts. A law firm might develop a smart document to create and manage contracts. When an employee creates a new contract with a smart document, it can automatically use the correct organization and formatting for that type of contract. Document fragments in the smart document allow users to easily insert boilerplate text into the contract. For greater flexibility and efficiency, this boilerplate text can reside in external, supporting Office Word 2003 documents. When the boilerplate text needs to be changed, a user opens the Word document, makes the change, and saves the document. All boilerplate changes are then propagated to all new documents created with the smart document.
  • Newspaper and magazine articles. Magazine or newspaper writers often need to follow an editing and scheduling process to get an article from a rough draft into a published magazine or newspaper. A smart document can provide the same consistency with formatting as a regular Office Word 2003 document template, but it can also be programmed to "know" where the article is in the editing process. Is it a rough draft, or has it been copy edited? Is it ready to be published, or was it published in last month's issue? A smart document can also know who the writer is and who needs to edit the article, how many words or characters are in the article, and whether the word count is under or over the required number of words.

These types of documents often use common formatting or outlining standards. There might also be reusable elements, such as boilerplate text for legal documents, and there might be a workflow or review process that must be followed. All of these — formatting, boilerplate text, and process flow — are simplified by using a smart document.

Smart Tags

Knowledge workers use a variety of applications to manage data. Whether the primary purpose of these applications is communicating, analyzing, or describing data, the types of data that are involved are very similar.

Smart tags were first introduced in Microsoft Office XP and are supported in Microsoft Word 2002, Microsoft Excel 2002, and to a limited extent in Microsoft Outlook 2002 (when Word is used as the Outlook e-mail editor or when reading HTML e-mail messages). There was also support for exposing smart tag actions within Microsoft Internet Explorer, so that documents created with Office applications will retain their smart tags when viewed as a Web page.

With the release of Microsoft Office 2003 Editions, smart tag support has been extended to PowerPoint and Access 2003. In addition, the Office 2003 Research task pane and Persona Menu features that are available in Office applications support smart tags. Office 2003 also adds enhancements and improvements to smart tags based on feedback from users and developers.

Most knowledge workers use a limited set of types of data or information such as names, addresses, dates, or telephone numbers. Smart tags provide a way to link specified types of data across applications.

For example, let's examine a scenario where a manager is creating a list of employee names in a Word report, and in an Excel spreadsheet. The employee names also appear in the same format in Outlook. Without smart tags, this identical information is just data (a "string"), and these applications will process the data only in the context of the particular tasks that the applications were designed to perform. If the manager needs more information about an employee mentioned in a Word 2003 report, she has to launch a separate application to complete this simple task. The smart tag infrastructure can change this workflow by adding intelligence to data strings that you use in your Office applications.

A smart tag is a string with type information attached to it. With smart tags, the manager in the previous example can use the smart tag intelligence of Office applications to provide a list of intuitive actions for a string that is typed as a "person's name." From that list, the manager can select the most appropriate action. The actions include sending an e-mail message, scheduling a meeting , and getting the telephone number or other personal records of the employee.

Smart tags enable the dynamic recognition of terms within documents, making data in Office documents more meaningful and easier to act on. As a user enters information in an application that supports smart tags, strings of certain types are dynamically recognized and automatically tagged as the document is created. Once a term is recognized, the user can invoke an action from a list associated with that particular smart tag. For example, the user can insert relevant data, link to a Web page, look up data in a database, convert data to another format, and so on.

You can supply logic and a set of consistent actions for data by defining a common interface for annotating data within documents, and providing a standard architecture for associating actions with this annotated data. To make a software development analogy, you can think of smart tags as making tasks "object-oriented," rather than "application-oriented."

You can extend the capabilities of applications that support smart tags by developing smart tag "recognizers" that identify strings of one or more specific types (for instance, a book title, chemical formula, or case number). These recognizers communicate with an application that supports smart tags to identify the text that a user entered. Recognizers then apply a recognition algorithm on the text and communicate the identity of recognized strings to the application.

Smart tags save users time and effort by streamlining tasks that are currently performed with complicated manual procedures. With the current smart tag support in Word, Excel, PowerPoint, and Access, users do not need to launch multiple applications to accomplish a simple task or spend time searching the Web to find a specified Web site. Users can be taken where they want to go from within their Office application and be conveniently linked to critical internal corporate resources. The benefits that can be achieved with smart tag technology are wide and far-reaching. For more information, see the Microsoft Office 2003 Smart Tag SDK.

InsertText field

Often knowledge workers come across XML files, or portions of XML files, that they would like to incorporate into their documents. For example, you may be writing a financial report in Word and locate some XML based tables that list your quarterly results on the Internet. Adding these tables to a document is made easy with the IncludeText field. Using this, you can repurpose text and maintain all of its formatting, while also allowing it to be fully editable when you're finished. This feature takes full advantage of the benefits of XML based content.

Here are some of the features that allow useful flexibility when utilizing the IncludeText feature:

  • You can bring in all or part of an XML file that is either a local file or an the Internet. Note that the file's extension does not need to be ".xml" since there are services on the Internet whose URL's look like script URL's, such as ".asp" files, but have output in XML.
  • You can bring in any or all namespaces by specifying exactly what namespaces you would like to incorporate in the Namespace mappings check box of the Field dialog.
  • You can bring in specific XPaths using the namespace mappings. Suppose you bring in a namespace called "reports" and map it to "a" by adding "xmlns:a="reports" in the Namespace mappings check box of the Field dialog. You can then bring in specific elements in the "reports" namespace using XPaths. If the root element is "reports," and you want only the contents of its child element called "financial," you would enter "a:reports/a:financial".
  • You can bring in the XML already formatted by specifying the transform to use in the XSL Transformation text box in the Field dialog.
  • Once the XML data has been incorporated into your file, you can edit it using all of the wide range of XML editing capabilities in Office Word 2003.

Instructions on this feature's user interface are in the Inserting XML Markup topic.

Document protection

One of the new powerful features in Office Word 2003 is the ability to protect documents. Not only does it protect documents from the wrong people editing it, but it enables management of rights to a document in a collaboration scenario. Say user A is a document owner and would like to protect it from changes by all users with a few exceptions. For example, user A may like to give user B editing rights to one section, like a Summary section, while allowing user C to edit the Introduction of the document. If user A has created a Document Workspace site (DWS) in SharePoint where the document lives along with other files that all three users collaborate on. When user A chooses Protect Document from the Tools menu, the list of collaborators that belong to the DWS all will appear in the pane, allowing the document owner to select which user can have what specific rights to each portion of the document.

The document owner can specify specific editing restrictions, like allowing only the ability to track changes or add comments. The owner can also restrict permissions

For users that are not owners of a document, but who may have limited rights to it, the Protect Document task pane quickly tells them what areas of the document they can edit.

Further information pertaining to document protection:

©2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp