Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Raise Method

Commands.Raise Method

Executes the specified command.

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

Sub Raise ( _
	Guid As String, _
	ID As Integer, _
	<OutAttribute> ByRef CustomIn As Object, _
	<OutAttribute> ByRef CustomOut As Object _


Type: System.String

Required. The command's GUID.

Type: System.Int32

Required. The command's ID.

Type: System.Object

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

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

© 2015 Microsoft