Agent 2003: Get Smart on Smart Documents and XML
Are Smart Documents for document assembly? How does XML tie in? What’s in it for law firms? I discussed these introductory questions and more with my XML dream team of Sherry Kappel, Microsystems’ senior VP and chief innovation officer, and Leah Matthews, a senior developer from Payne Consulting Group who is already busily creating Smart Document and XML solutions.
By the way, I can’t figure out why they called it Smart Documents. You don’t have to be a Mensan to use this successfully. Then again, the feature may not have been as widely accepted if they had dubbed it “Dumb Documents!”
About Smart Documents
Smart Documents is a programmatic solution written in Microsoft Visual Basic 6.0, .NET, Visual C# .NET or Microsoft Visual C++. Notice that I didn’t list Visual Basic for Applications as an option. Unfortunately, Smart Documents can’t be written with VBA. We hear its days are numbered, and its lack of capability with Smart Documents sends a clear signal that VBA won’t be what we are writing tools in for subsequent releases.
Smart documents are associated with an XML schema. When the Smart Document is initially constructed, start and stop XML tags are added where the text will be added, and it is either pulled from a database or manually entered. This data appears in the Task Pane, organized to group types of data to make it easier to find what you need and then insert it.
XML Tag Format
In order for smart documents to function, they need embedded XML tags. Say you have a client named Mutual Bank. A Start of Name tag appears before the name and an End of Name tag specifies where the name will end. The actual client name must appear between these tags.
When a client name is selected, it fills the information into all the client name locations. Likewise, the address is adjusted based on which client is selected.
When the active cursor location is between the start and end tags, elements are available in the Task Pane that can be added to the document. Payne has created contracts, client matter and forms, all of which include articles, confidentiality phrases and other document assembly type data. Each item appears in the Document Actions Task Pane when the cursor is positioned between the start of articles and end of each tag.
Quizzing the Smart Documents Experts
Q: Smart documents are created with XML, but what exactly is this?
Leah: XML stands for eXtensible Markup Language, and it’s published by W3C (the consortium responsible for maintaining Internet standards). XML uses tags to identify elements in a document that affect structure and type of data, as well as format. XML provides a way to distinguish between a document’s data and its appearance. An XML schema, or Schema Definition (XSD), is a file that describes the structure of data in an XML document, defining elements, attributes and their data types.
Q: Is this technology viable for a law firm and if so, how soon should firms replace what they currently have with Smart Documents?
Sherry: For any document currently created with document assembly methods or extensive use of dialogue boxes, databases and/or AutoText, Smart Documents and XML greatly simplify storage, maintenance and interface delivery. This won’t come about without development investment, either through the template community or the firm itself. However, Microsoft has provided tools, examples and “accelerated” solutions to jump-start the process.
Q: Do you see XML or Smart Documents being used in ways other than templates and forms or light document assembly?
Sherry: Yes. Conceivably one could develop Smart tags to perform more than just data entry lookup.
Q: What do each of you think the future of VBA is?
Leah: At a developer conference I recently attended, they stated that VBA wasn’t going away and then winked! That wink underscores what I’ve been hearing and reading about VBA’s questionable future.
Sherry: I agree with Leah. We need to cultivate our .NET expertise but not abandon any hard-won VBA or VB knowledge too soon. While you can automate Office 2003 applications using .NET, it may not deliver the rapid development environment law firms have grown accustomed to in VB or VBA. You need a transition plan where your current VB/VBA COM applications are maintained, while appropriate bits are refactored into VB.NET. Examples would be anything you’re currently doing in ASP or ADO. The COM components can stay put, for now.
Q: Are there new XML-related objects in the object model?
Leah: Yes. The new XML objects are XMLChildNodeSuggestion, XMLNamespace, XMLNode, XMLSchemaReference and XMLTransform, each with associated collection objects. Enhancements to existing objects and collections allow us allow us to programmatically control XML-related functionality; for example, attaching an XML schema to a document or saving document data as XML. This is a huge benefit.
Q: What do you want to share with readers about XML or Smart Documents?
Sherry: Finally, a glimpse into the Word psyche ...
Although we’ve had the desire and the need, none of us have ever had a way to “see” the way Word thinks. And in spite of the buzz surrounding Microsoft’s implementation of XML, few of us are keen to learn yet another electronic method of expressing ourselves. It turns out, armed only with a document problem or question to solve, you can wield Word 2003’s XML result as if it were “Reveal Codes” on steroids – no XML-fluency required.
So far, we’ve used this new technique to:
Exfoliate templates: If you’re tired of taking each of your templates and laboriously copying styles, toolbars and code as you move to a later version of Word, try File | Save As | XML in Word 2003. It round-trips everything except toolbars, keyboard shortcuts, and the “binary build-up” you want to eliminate, anyway.
Desperately seek – and find – all used fonts: It’s painstaking to gather a list of all fonts used in a document – except if you’re looking at an XML edition. File | Save As | XML, open the result in any ASCII file editor, and seek out the “<w:fonts>” tag. The list which appears between this tag and the closing “</w:fonts>” tag identifies all fonts used in the document.
Exterminate undesirable fonts: Taking the previous trick a bit further, it’s possible to delete a font name from the fonts listing, then replace all occurrences of it in the XML file. When you reopen the file in Word, those annoying legacy fonts and all of applied inconsistencies are gone.
Other XML Aerobics
In the coming months, we’ll exercise Word 2003’s XML filter against several theories, among them:
-
Creating Word documents without using Word
-
Storing numbering definitions in XML files, then pulling them into documents or templates without need for VBA code, Organizer, Style Gallery, copy/paste, or templates
-
Seeking special symbol traits that foil results at print time or comparison
Leah: There are many resources available to help you learn the technology. Here are some that have helped me get up to speed, all of which are available on the Microsoft website:
-
Microsoft Word XML Content Developer Kit – Information on creating XML documents in Word, along with several samples, the XML Developer’s Guide and other reference materials
-
XML Toolbox for Microsoft Office 2003 – Assistance in working with new XML features of Office 2003, with tools that include XML Viewer and utilities to convert custom tags to XML nodes and generate a schema from tags in a current document
-
Smart Document SDK – Documentation on Smart Documents and several code samples, including a legal contract
-
Microsoft Office 2003 XML Reference Schemas – Documentation on every element and type used in XML file formats for Word 2003 (WordprocessingML), Excel 2003 (SpreadsheetML) and InfoPath 2003 (FormTemplateXML)
Final Thoughts
It makes sense for law firms to explore Smart Documents and XML. And XML may provide the added benefit of creating a standard for sharing documents electronically, regardless of which software program creates them. LegalXML, a section of the not-for-profit consortium called Oasis, is producing standards for electronic court filing, court documents, legal citations, transcripts, criminal justice intelligence systems and others. For more information on their efforts, visit www.legalxml.org/.
So is this feature right for your firm? Only you can answer that after digging in and finding out what XML and Smart Documents have to offer. If you would like to see smart documents in action, please contact me at the address below.
About our author …
Donna Payne is president and founder of Payne Consulting Group, a training and development company in Seattle. She and the company have authored 10 books on Microsoft Office, including the popular series, “Word for Law Firms.” She is a member of the American Bar Association, Microsoft Legal Advisory Counsel and American Society of Journalists and Authors and a columnist for several legal and technical publications. She can be reached at donnapayne@payneconsulting.com.