激活与单元格中智能标记类型相关的智能标记操作。
expression.Execute
expression 必需。该表达式返回“应用于”列表中的对象之一。
本示例为股票行情自动收录器符号“MSFT”插入一个可刷新的股票报盘,假定主机系统已连至 Internet。
Sub ExecuteASmartTag()
Dim strAction As String
strAction = "Insert refreshable stock price"
' Enable smart tags to be embedded and recognized.
ActiveWorkbook.SmartTagOptions.EmbedSmartTags = True
Application.SmartTagRecognizers.Recognize = True
' Invoke a smart tag for the Microsoft ticker symbol.
With Range("A1")
.Formula = "MSFT"
.SmartTags( _
"urn:schemas-microsoft-com:office:smarttags#stockticker") _
.SmartTagActions(strAction).Execute
End With
End Sub