Action.BeforeCaptionShow 事件

在使用者按一下智慧標籤圖示之後,顯示智慧標籤功能表之前發生。 這個類型或成員僅適用於 2007 Microsoft Office system 專案。智慧標籤在 Office 2010 中已被取代。
.

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)

語法

'宣告
Event BeforeCaptionShow As BeforeCaptionShowEventHandler
event BeforeCaptionShowEventHandler BeforeCaptionShow

備註

此事件可讓您根據內容變更智慧標籤的標題。

範例

下列程式碼範例將示範 BeforeCaptionShow 事件的處理常式。 事件處理常式會修改動作的功能表標題。 這個程式碼範例是 Action 的完整範例的一部分。

Private Sub DisplayAddress_BeforeCaptionShow(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ActionEventArgs) _
    Handles displayAddress.BeforeCaptionShow

    Dim clickedAction As Microsoft.Office.Tools.Word.Action = _
        TryCast(sender, Microsoft.Office.Tools.Word.Action)

    If clickedAction IsNot Nothing Then
        clickedAction.Caption = "Display the location of " & e.Text
    End If
End Sub
void displayAddress_BeforeCaptionShow(object sender,
    Microsoft.Office.Tools.Word.ActionEventArgs e)
{
    Microsoft.Office.Tools.Word.Action clickedAction =
        sender as Microsoft.Office.Tools.Word.Action;

    if (clickedAction != null)
    {
        clickedAction.Caption = "Display the location of " +
            e.Text;
    }
}

.NET Framework 安全性

請參閱

參考

Action 介面

Microsoft.Office.Tools.Word 命名空間