Action.BeforeCaptionShow Event

Occurs after the user clicks the smart tags icon, and before the smart tag menu is displayed.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

event BeforeCaptionShowEventHandler BeforeCaptionShow

This event gives you an opportunity to change the smart tag caption based on context.

For more information about handling events, see Consuming Events.

The following code example demonstrates a handler for the BeforeCaptionShow event. The event handler modifies the menu caption of the action. This code example is part of a larger example provided for Action.

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 " +

Community Additions