UsedCommand Element

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at UsedCommand Element.

Enables a VSPackage to access a command that is defined in another .vsct file. For example, if your VSPackage uses the standard Copy command, which is defined by the Visual Studio shell, you can add the command to a menu or toolbar without re-implementing it.

<UsedCommand guid="guidMyCommandGroup" id="MyCommand" />  

The following sections describe attributes, child elements, and parent elements.

Attributes

AttributeDescription
guidRequired. The GUID of the GUID ID pair that identifies the command.
idRequired. The ID of the GUID ID pair that identifies the command.
ConditionOptional. See Conditional Attributes.

Child Elements

ElementDescription
None

Parent Elements

ElementDescription
UsedCommands ElementGroups UsedCommand elements and other UsedCommands groupings.

By adding a command to the <UsedCommands> element, a VSPackage informs the Visual Studio environment that the VSPackage requires the command. You should add a <UsedCommand> element for any command your package requires that might not be included in all versions and configurations of Visual Studio. For example, if your package calls a command that is specific to Visual C++, the command will not be available to users of Visual Web Developer unless you include a <UsedCommand> element for the command.

<UsedCommands>  
  <UsedCommand guid="guidVSStd97" id="cmdidCut"/>  
  <UsedCommand guid="guidVSStd97" id="cmdidCopy"/>  
  <UsedCommand guid="guidVSStd97" id="cmdidPaste"/>  
</UsedCommands>  

UsedCommands Element
Visual Studio Command Table (.Vsct) Files

Show: