This documentation is archived and is not being maintained.

Raise Method

Visual Studio .NET 2003

Executes the specified command.

[Visual Basic .NET]
Public Sub Raise( _
   ByVal Guid As String, _
   ByVal ID As Integer, _
   ByRef CustomIn As Object, _
   ByRef CustomOut As Object _
[Visual Basic 6]
Sub Raise( _
   ByVal Guid As String, _
   ByVal ID As Long, _
   ByRef CustomIn As Variant, _
   ByRef CustomOut As Variant _
HRESULT __stdcall Raise(
   BSTR Guid,
   long ID,
   VARIANT* CustomIn,
   VARIANT* CustomOut
public void Raise(
   string Guid,
   int ID,
   ref object CustomIn,
   ref object CustomOut
[JScript .NET]
public function Raise(
   Guid : String,
   ID : int,
   CustomIn : Object,
   CustomOut : Object


Required. The command's GUID.
Required. The command's ID.
Required. Arguments in a SafeArray passed in from the OLECommandTarget.
Required. Arguments in a SafeArray passed out to be returned by the OLECommandTarget.


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

See Also

Applies To: Commands Collection