Smart Tags

Smart Tags were introduced in Office 2002 and depreciated in Office 2010
You can still use the related APIs in Excel and Word 2010 but recognized terms are no longer underlined and any custom actions appear on a "Additional Actions" sub menu


C:\Program Files\Common Files\Microsoft Shared\Smart Tag\MOFL.dll
https://www.microsoft.com/en-us/download/details.aspx?id=21034


Both document-level and application-level
These are specific to document
Provides a SmartTag class that lets you easily specify the terms to recognise and the actions to take
You must implement the ISmartDocument interface


You display a smart tag against particular items to allow the user to take further action.
Office 2002 comes with some built-in smart tag recognizers.


Smart Tags are tools that recognize certain type of data within an Office document and present the user with a list of predefined actions.


This is usually accessible from the AutoCorrect Options dialog box. Include links to Excel and Word smart tag pages


Application.SmartTagRecognizers


Interfaces

Smart tags involve 2 interfaces
ISmartTagRecognizer - Determines what is recognised
ISmartTagAction - Menu commands that appear on the pop-up menu.



Document-Level

VSTO provides 2 smart tag classes:
Office.Tools.Excel.SmartTag
Office.Tools.Word.SmartTag
These classes are then used to add strings to the Terms property or to add regular expressions to the Expressions property.



Application Level

Can be created with a VSTO or COM add-in and often called "Office Smart Tags".


Create a Class Library that contains the following two classes:
Recognizer Class - implements ISmartTagRecognizer
Action Class - implements ISmartTagAction



Office.Tools.Excel.Action
Office.Tools.Word.Action




SmartTag Properties

Action - enables you to get or set a number of actions
Caption - read only enables you to retrieve the text displayed at the top of the smart tag menu
Expressions - enables you to add a collection of regular expressions to the smart tag
SmartTagType - read only lets you retrieve the smart tags unique namespace identifier
Terms - enables you to add individual words you want to recognise. It only recognises single words, no spaces.


Smart Documents

These were introduced in Office 2003 as a way of combining business logic and custom actions.


The idea behind the Smart Documents was that the Document Actions task pane would integrate with the new Excel and Word XML features introduced in Office 2003 to build documents that are "smart" about their content and provide an appropriate user interface.


Limitations:
1) Smart Documents implement the ISmartDocument interface which is a COM interface.
2) To use a smart document you must have an XML schema mapped in your document and not all documents need to want to use an XML mapping.
3) The Document Actions task pane only supports a small subset of built-in controls and ActiveX controls.
4) Smart documents require you to create an Expansion Pack.



Here are the basic steps involved in creating a SmartDocument application:

  • Create a document template that users will fill out to submit information.

  • Create an XSD schema that logically relates to the content (entities) in the document template that you intend to capture.

  • Apply the XSD schema to the document.

  • Create shims which implement the ISmartDocument interface and hookup the shim implementation to call managed code. Shims in this case are unmanaged DLL's that are restricted to loading assemblies built in managed code.

  • Implement the ISmartDocument interface in your managed code. The managed code encapsulates all the business logic for the application.

  • Create an XML manifest for downloading the application-dependent files. You could also create MSI packages, which could contain XML manifest files for deployment.


© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Top

PrevNext