Share via


Smart Tag Reloading Without Restarting the Application [Office 2003 SDK Documentation]

In Office XP, smart tag recognizers and actions are loaded only at application boot time. For example, when a user follows a download URL, the action they download isn't available until they close and restart all smart tag supporting applications. This is annoying, especially for actions that would have saved you a lot of time, but which you may use rarely. Also various office solutions include smart tag recognition components that may be updated or installed on the fly, but getting them running requires the application to be restarted which can be inconvenient.

In Office 2003, support has been added to enable the reloading of smart tag without requiring smart tag supporting applications to be restarted to get the newly installed smart tag running. This greatly increases the ease of use of smart tags—you don't have to force users to reboot applications simply because they installed a new smart tag recognizer or action.

Reloading of smart tags while a smart tag supporting application is open isn't automatic. You can force a reload while an application is opened in two different ways:

1. Run SmartTagInstall.exe

The SmartTagInstall.exe is a tool that you can run post smart tag installation on the client machine. When run, it will force the new smart tag (and also all other installed smart tags on the machine) to load/reload even if the smart tag supporting applications are open. You can run the SmartTagInstall.exe as part of your setup by using shell execution command or custom action that runs the SmartTagInstall.exe during the install. You can also double clicking on the SmartTagInstall.exe file to run it.

The SmartTagInstall.exe file is included in Office 2003. You can find it in the following directory location:

<Drive>:\Program Files\Common Files\Microsoft Shared\Smart Tag

Note  SmartTagInstall.exe tool doesn't work with PowerPoint. This means if you install a new smart tag DLL or smart tag XML list while PowerPoint is opened, then go to C:\Program Files\Common Files\Microsoft Shared\Smart Tag\ and double click on SmartTagInstall.exe (or run a shell execution command) to force a reload of smart tags, you won't get the newly installed smart tag running in PowerPoint until you restart PowerPoint.

2. Run the following VBA code:

Application.SmartTagRecognizers.ReloadRecognizers

When you run the above VBA code, the reload only happens in the application where you run this command. For example, if you run the code in Word, reload will only happen for Word.

Note  This will also reload mofl.dll (the smart tag DLL for the Microsoft Office Smart Tag List (MOSTL)) which means if you place a new xml file in the MOSTL directory, the new xml file will get parsed and its content used. The MOSTL directory is located at <Drive>:\Program Files\Common Files\Microsoft Shared\Smart Tag\LISTS

Caution  The following issue is only relevant if you are also doing smart documents development. If you force a reload of smart tags, it will cause your currently opened smart documents solution to be detached. This means, you will need to reattach your solution for your currently opened smart documents to work again. Note that you will also run into this issue if you install a fresh new smart document solution or delete an existing one (because in these cases too, all the smart tags/smart documents will be reloaded). For more information, see the Microsoft Office 2003 Smart Documents Software Development Kit.

Note  One downside of reloading smart tag recognizers and actions is that the reference to smart tag objects will become stale after a reload. For this reason, a reference to smart tag objects should not be cached.