다음을 통해 공유


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

Definition

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. Arguments in a SafeArray passed in from the OLECommandTarget.

CustomOut
Object

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

Attributes

Examples

' 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  

Applies to