Smart Tag Object

The Range object has a SmartTags property that returns the collection of all SmartTag objects. Of course, a SmartTag object represents a smart tag. Let us discuss the more important members of the SmartTag object, listed next. (The Delete method is self-explanatory.)

• Delete method

• Name property

• DownloadURL property

• SmartTagActions property

The Name property of the SmartTag object returns a fully qualified name for the smart tag. A fully qualified name consists of a XML namespace URI followed by a number sign (#) and then the tag name. For instance, referring to the smart tag in Figure 22-2, the code:

Debug.Print st.Name prints:

urn:schemas-microsoft-com:office:smarttags#stockticker

Do not confuse the name of the smart tag with the text, such as IBM, of the smart tag. There does not appear to be a smart tag member that returns the smart tag's text.

The DownloadURL property is an optional URL that is specified by the smart tag's creator. It provides an address where additional smart tag actions may be available for download.

According to the Microsoft documentation, the read-only XML property of the smart tag object "Returns a String representing a sample of the XML that would be passed to the action handler." The term "sample" could certainly use clarification. In any case, for the smart tag in Figure 22-2, the code:

Debug.Print st.XML produces the string:

<xml xmlns:fa1="urn:schemas-microsoft-

com:office:smarttags"><fa1:stockticker>IBM</fa1:stockticker></xml> which contains the smart tag's fully qualified name as well as the tag's text (IBM).

0 0

Post a comment