Commands2.Raise(String, Int32, Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Executes the specified command.
public:
 void Raise(System::String ^ Guid, int ID, [Runtime::InteropServices::Out] System::Object ^ % CustomIn, [Runtime::InteropServices::Out] System::Object ^ % CustomOut);
	void Raise(std::wstring const & Guid, int ID, [Runtime::InteropServices::Out] winrt::Windows::Foundation::IInspectable const & & CustomIn, [Runtime::InteropServices::Out] winrt::Windows::Foundation::IInspectable const & & CustomOut);
	[System.Runtime.InteropServices.DispId(4)]
public void Raise(string Guid, int ID, out object CustomIn, out object CustomOut);
	[<System.Runtime.InteropServices.DispId(4)>]
abstract member Raise : string * int * obj * obj -> unit
	Public Sub Raise (Guid As String, ID As Integer, ByRef CustomIn As Object, ByRef CustomOut As Object)
	Parameters
- Guid
 - String
 
Required. The command's GUID.
- ID
 - Int32
 
Required. The command's ID.
- CustomIn
 - Object
 
Required. The in parameters for OLECommandTarget.
- CustomOut
 - Object
 
Required. The out parameters for OLECommandTarget.
Implements
- Attributes
 
Examples
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