Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

OFFXP: How to Create a Microsoft Office Smart Tag List


View products that this article applies to.

Summary

You can create custom smart tags for use in Microsoft Office XP by using Extensible Markup Language (XML). Smart tags created in this way are called Smart Tag Lists. These Smart Tag Lists can only recognize a static list of terms and make use of Web-based actions.

This article contains a sample of the XML code that is needed to create a Smart Tag List.

↑ Back to the top


More information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

Sample XML Code to Create a Smart Tag List

<FL:smarttaglist xmlns:FL="urn:schemas-microsoft-com:smarttags:list">
    <FL:name>MSN City Lookup</FL:name> 
    <FL:lcid>1033,0</FL:lcid> 
    <FL:description>Looks up City Guides on MSN</FL:description> 
    <FL:updateable>false</FL:updateable> 
    <FL:updatefrequency>10080</FL:updatefrequency> 
    <FL:autoupdate>true</FL:autoupdate> 
    <FL:smarttag type="urn:schemas-microsoft-com:office:smarttags#CityGuide">
        <FL:caption>MSN City</FL:caption> 
        <FL:terms>
            <FL:termlist>Atlanta,Austin,Boston,Chicago,Dallas,Denver,Detroit,Miami,Philadelphia,Phoenix,Seattle</FL:termlist>
        </FL:terms>
        <FL:actions>
<FL:action id="CityGuidLookup">
<FL:caption>Lookup MSN City Guide</FL:caption>
<FL:url>http://{TEXT}.msn.com</FL:url>
</FL:action>
</FL:actions>
    </FL:smarttag>
</FL:smarttaglist> 

				
To use the preceding code, follow these steps.

NOTE: Close all Microsoft Office XP programs first.
  1. Select all of the preceding code, and copy the selection.
  2. Open Notepad.
  3. Paste the code into a new Notepad file.
  4. On the File menu, select Save As.
  5. In the Save As dialog box, browse to the following folder:
    C:\Program Files\Common Files\Microsoft Shared\Smart Tag\Lists
  6. Save the file in this folder as "CityGuide.XML"

    NOTE The quotation marks around the file name are required to ensure that a .txt extension is not added to the file name.
  7. Start Microsoft Excel 2002 or Microsoft Word 2002.
  8. On the Tools menu, click AutoCorrect Options, and then click the Smart Tags tab.
  9. In Excel, verify that the Label data with smart tags check box is selected. In Word, verify that the Label text with smart tags check box is selected. In both programs, verify that the Smart tag lists check box is selected in the Recognizers List. Click OK to close the dialog box.
  10. In the open spreadsheet or document, type Seattle. Notice the smart tag indicator that appears.
  11. Click the Smart Tag button, and then select Lookup MSN City Guide.
Smart Tag Lists created with XML do not require you to compile a DLL. Instead, they use the Mofl.dll file that is included with Microsoft Office XP. This means that all Smart Tag Lists are turned on or off as a group in the Smart Tag Options dialog box.

For more information about creating smart tags, refer to the Microsoft Smart Tag Software Developer's Kit at the following Microsoft Web site:

↑ Back to the top


Keywords: KB287698, kbhowto

↑ Back to the top

Article Info
Article ID : 287698
Revision : 8
Created on : 1/31/2007
Published on : 1/31/2007
Exists online : False
Views : 378