Five Things You Should Know About Microsoft Smart Documents - Mauro Cardarelli

Smart documents are a new feature of the Office System version of Microsoft Word and Excel. Smart document technology provides the architecture to build custom context-sensitive Word and Excel templates. This article answers five key questions about smart documents.

What is a smart document?

A smart document is a Microsoft Word 2003 or Excel 2003 document that has been programmatically customized to provide context sensitive information within the standard product interface. The user interaction is managed in the task pane, outside the document “working area”. Based on the location of the cursor, context sensitive information is displayed in the task pane. This can include help as well as controls for data retrieval or submissions. Data selected in the task pane can automatically be inserted into the designated area in the template.

What makes a smart document “smart”?

The architecture associated with a smart document is relatively straightforward. Smart document development relies heavily on the use of XML and some programmatic customization. It is the connection of these two components that make a smart document “smart”.

In effect, an XML schema is attached to a document. That same schema is used to develop the custom user interface for the smart document. An XML expansion pack component provided by Microsoft is used to connect the two.

When should I use a smart document?

The main advantage of a smart document over more traditional forms-based custom applications is its ability to provide data retrieval and submission in an already familiar and robust environment. It is important to note that all of the base functionality associated with Word or Excel is available in a smart document solution. The task pane is used simply guide the end user through the population of specific sections of that template. This facilitation can include interaction with various back-end data sources as a means of providing information lookup and validation. Smart documents are the right choice whenever the desired output is a physical file, especially one that requires high-fidelity printing. Examples of smart document solutions include expense reports, proposal generation and employee performance reviews.

Is a smart document secure?

Smart documents have a very good security model. Like a VBA macro, smart document solutions can only be initiated with the user’s permission. This is typically done through a prompt when the document is first loaded. Smart documents can be controlled through specific security polices and actions taken through the smart document code are subject to the user’s Office security settings. This is especially important when a template includes security for access or update permissions against a specific section of the file.

How do I deploy a smart document?

Smart document deployment is very simple. A developer, upon completing the custom coding, digitally signs the corresponding dll (i.e. compiled code) as well as the Solution Manifest file (which acts like a blueprint) and places the files in an appropriate location. An end user accesses a smart document exactly like any other Word or Excel file. Smart documents are typically deployed to a server. This makes distributing updates to the Word or Excel template as well as the custom coding very easy.