Command Command Command Command Command Command Interface

Definition

Represents a command in the environment.

public interface class Command
public interface class Command
__interface Command
[System.Runtime.InteropServices.Guid("5FE10FB0-91A1-4E55-BAAA-ECCAE5CCEB94")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface Command
type Command = interface
Public Interface Command
Attributes

Examples

Sub CommandExample()  
  ' Creates a text document listing all command names.  
  Dim Cmd As Command  
  Dim Doc As Document  
  Dim TxtDoc As TextDocument  
  
  ' Create a new text document.  
  DTE.ItemOperations.NewFile ("General\Text File")  
  Set Doc = ActiveDocument  
  Set TxtDoc = Doc.Object("TextDocument")  
  For Each Cmd In Commands  
  If (Cmd.Name <> "") Then  
    TxtDoc.Selection.Text = Cmd.Name & vbLF  
    TxtDoc.Selection.Collapse  
  End If  
  Next  
End Sub  

Remarks

Reference this object by using Item.

You can reference this object a number of ways, such as by using the canonical name or the GUID ID. The easiest way to invoke most commands is by using ExecuteCommand. You can use Raise for the rare instances when you must invoke a command without a name.

Properties

Bindings Bindings Bindings Bindings Bindings Bindings

Sets or gets the list of keystrokes used to invoke the command.

Collection Collection Collection Collection Collection Collection

Gets the Commands collection containing the Command object.

DTE DTE DTE DTE DTE DTE

Gets the top-level extensibility object.

Guid Guid Guid Guid Guid Guid

Gets the GUID for the given object.

ID ID ID ID ID ID

Gets the ID within a command group GUID used to represent the command.

IsAvailable IsAvailable IsAvailable IsAvailable IsAvailable IsAvailable

Gets a value indicating whether or not the Command is currently enabled.

LocalizedName LocalizedName LocalizedName LocalizedName LocalizedName LocalizedName

Gets the localized name of the command.

Name Name Name Name Name Name

Gets the name of the object.

Methods

AddControl(Object, Int32) AddControl(Object, Int32) AddControl(Object, Int32) AddControl(Object, Int32) AddControl(Object, Int32) AddControl(Object, Int32)

Creates a persistent command bar control for the command.

Delete() Delete() Delete() Delete() Delete() Delete()

Removes a named command that was created with the AddNamedCommand(AddIn, String, String, String, Boolean, Int32, Object[], Int32) method.

Applies to