RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Using Smart Tags in Office 2003

Smart tags in Office 2003 have been improved to make them easier to develop and to address a few limitations that were found in Office XP. You can now create recognizers for smart tag Lists, which are XML documents, by using regular expressions. The Type Library has also been extended for more power when creating smart tags via code.

f you developed smart tags in Office XP, you'll be interested in the changes in Office 2003. Smart tag technology links text to resources that provide relevant information useful in creating a document. Or even better, relevant information can be inserted right into the document itself. Smart tags in Microsoft Office 2003 have been improved to make them even easier to develop, and they conquer a few limitations.

Smart tags were introduced in Microsoft Office XP, providing a new way to make more meaningful data in documents. A major change in Office 2003, the number of applications supporting smart tags has increased. In Office XP, smart tags were supported in Word, Excel, Outlook (with Word as the e-mail editor), and Internet Explorer, to a limited extent. In Office 2003, all these applications are supported and both PowerPoint 2003 and Access 2003 have been added.

New features have been added to the Microsoft Office Smart Tag Lists (MOSTL). MOSTL provides the capability to define smart tag recognizers in XML. Although it's not as flexible as implementing smart tags in a programming language, it's great when you have an easily defined list of words or phrases to be recognized. You can use regular expressions to define search patterns for your recognizer and you'll see a few examples using MOSTL and regular expressions later in this article.

In addition, the API library has been extended, supporting several new interfaces and enabling new functionality. The Microsoft Smart Tags 2.0 Type Library is backward compatible with the 1.0 version, allowing you to develop smart tags that work in both Office XP and Office 2003. This type library and an example of implementing a smart tag in .NET are discussed in more detail later in this article.

An Introduction to Smart Tags
Smart Tags identify words or phrases within a document, and several are provided with Microsoft Office. For a list of existing smart tags, and to enable and disable smart tags, go to Tools (from within any of the applicable Office 2003 applications) and then choose Auto Correct Options. Click on the Smart Tags tab and you'll see a list of available smart tags.

Figure 1: The smart tag shows the financial symbol and its smart tag drop-down menu.
To experiment, enable the Financial Symbols smart tag. Then enter a stock symbol, such as MSFT, in a Word 2003 document. When the symbol is recognized, smart tags make a red-dotted underline under it. When you hover your mouse pointer over it, you'll see an information icon. Clicking on the icon displays a drop-down menu, as shown in Figure 1. The menu shows a list of actions relevant to the financial symbol.

Another smart tag might look up contact information in your Outlook 2003 contact list. Figure 2 shows the drop-down menu and the actions available with that smart tag.

Although these are good examples of smart tags in action, the number of provided smart tags is limited. It is possible to create your own smart tags using MOSTL or by developing them in a programming language. Then the possibilities of what you can do with smart tags are virtually endless!

Thanks for your registration, follow us on our social networks to keep up-to-date