SmartTagAction 对象

         
SmartTagActions
SmartTagAction

代表可用智能标记执行的操作

SmartTagAction 对象用法

可用 SmartTagActions 对象的 Item 属性返回一个 SmartTagAction 对象。

返回一个 SmartTagAction 对象后,便可激活一个智能标记,从而可用 Execute 方法自动对数据进行注释。本示例为股票行情自动收录器符号“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