This documentation is archived and is not being maintained.

Commands.Raise Method

Executes the specified command.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

void Raise (
	[InAttribute] string Guid,
	[InAttribute] int ID,
	[InAttribute] out Object CustomIn,
	[InAttribute] out Object CustomOut
)
void Raise (
	/** @attribute InAttribute() */ String Guid, 
	/** @attribute InAttribute() */ int ID, 
	/** @attribute InAttribute() */ /** @attribute OutAttribute() */ /** @ref */ Object CustomIn, 
	/** @attribute InAttribute() */ /** @attribute OutAttribute() */ /** @ref */ Object CustomOut
)
JScript does not support passing value-type arguments by reference.

Parameters

Guid

Required. The command's GUID.

ID

Required. The command's ID.

CustomIn

Required. Arguments in a SafeArray passed in from the OLECommandTarget.

CustomOut

Required. Arguments in a SafeArray passed out to be returned by the OLECommandTarget.

' Macro code.
Sub RaiseExample()
   ' Before running, you must add a reference to the Office 
   ' typelib to gain access to the CommandBar object.
   Dim cmds As Commands
   Dim cmdobj As Command
   Dim customin, customout As Object
   Dim colAddins As AddIns

   ' Set references.
   colAddins = DTE.AddIns()
   cmds = DTE.Commands
   cmdobj = cmds.Item("File.NewFile")

   ' Execute the File.NewFile command.
   cmds.Raise(cmdobj.Guid, cmdobj.ID, customin, customout)
End Sub
Show: