Commands.Raise Method (String, Int32, Object, Object)

 

Executes the specified command.

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

No code example is currently available or this language may not be supported.

Parameters

Guid
Type: System.String

Required. The command's GUID.

ID
Type: System.Int32

Required. The command's ID.

CustomIn
Type: System.Object

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

CustomOut
Type: System.Object

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

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

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