Share via


SmartTag.XML Property

Excel Developer Reference

Returns a String value that represents a sample of the XML that would be passed to the action handler.

Syntax

expression.XML

expression   A variable that represents a SmartTag object.

Example

This example adds a smart tag to cell A1 and then displays the XML that would be passed to the action handler. This example assumes the host system is connected to the Internet.

Visual Basic for Applications
  Sub CheckXML()
Dim strLink As String
Dim strType As String

' Define SmartTag variables.
strLink = "urn:schemas-microsoft-com:smarttags#StockTickerSymbol"
strType = "stockview"

' Enable smart tags to be embedded and recognized.
ActiveWorkbook.SmartTagOptions.EmbedSmartTags = True
Application.SmartTagRecognizers.Recognize = True

Range("A1").Formula = "MSFT"

' Display the sample of the XML.
MsgBox Range("A1").SmartTags.Add(strLink).<strong>XML</strong>

End Sub

See Also