Chapter 22. Smart Tags

In this chapter, I discuss the programmatic control of smart tags. Note that to create custom smart tags, we need to use an application that can create automation servers (COM DLLs), such as Visual Basic or Visual C++. Custom smart tags cannot be created in Excel XP, although existing smart tags can be controlled programmatically.

What Are Smart Tags?

Since smart tags are new to Office XP, let us begin with a brief description of their purpose. To illustrate the concept of a smart tag, imagine that you type a date, such as January 1, 2002, in Word XP (with smart tags turned on). The smart tag system recognizes the text “January 1, 2002” as a date and underlines it with a dotted line. If you then place the mouse over the date, a small button that looks like an “i” with a circle around it (a smart tag action button) appears. Clicking on this button drops down a list of actions, as shown in Figure 22-1.

The smart tag actions menu
Figure 22-1. The smart tag actions menu

From this menu, as the name suggests, we can choose an action to perform, such as scheduling a meeting on this date. Indeed, if we click on this action, Microsoft Outlook’s appointment dialog will open, wherein we can set up the meeting.

Figure 22-2 illustrates the use of smart tags in Excel XP. Here we have entered a stock ticker symbol into a worksheet cell, whereupon leaving the cell Excel XP will recognize ...

Get Writing Excel Macros with VBA, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.