ActionBase.Caption Property (2007 System)
Gets or sets the name of the action, as displayed in the smart tag menu.
Namespace: Microsoft.Office.Tools
Assembly: Microsoft.Office.Tools.Common.v9.0 (in Microsoft.Office.Tools.Common.v9.0.dll)
Syntax
'Declaration
Public Property Caption As String
'Usage
Dim instance As ActionBase
Dim value As String
value = instance.Caption
instance.Caption = value
public string Caption { get; set; }
public:
property String^ Caption {
String^ get ();
void set (String^ value);
}
public function get Caption () : String
public function set Caption (value : String)
Property Value
Type: System.String
The name of the action.
Examples
The following code example demonstrates a handler for the BeforeCaptionShow event. The event handler uses the Caption property to add the recognized smart tag term to the menu caption of a smart tag action. This code example is part of a larger example provided for the Microsoft.Office.Tools.Excel.Action class.
This example is for a document-level customization.
Private Sub DisplayAddress_BeforeCaptionShow(ByVal sender As Object, _
ByVal e As Microsoft.Office.Tools.Excel.ActionEventArgs) _
Handles DisplayAddress.BeforeCaptionShow
Dim clickedAction As Microsoft.Office.Tools.Excel.Action = _
TryCast(sender, Microsoft.Office.Tools.Excel.Action)
If clickedAction IsNot Nothing Then
clickedAction.Caption = "Display the address of " & e.Text
End If
End Sub
void DisplayAddress_BeforeCaptionShow(object sender,
Microsoft.Office.Tools.Excel.ActionEventArgs e)
{
Microsoft.Office.Tools.Excel.Action clickedAction =
sender as Microsoft.Office.Tools.Excel.Action;
if (clickedAction != null)
{
clickedAction.Caption = "Display the address of " +
e.Text;
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.