Commands.Raise(String, Int32, Object, Object) 方法

定义

执行指定的命令。

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)

参数

Guid
String

必需。 命令的 GUID。

ID
Int32

必需。 命令的 ID。

CustomIn
Object

必需。 SafeArray 中从 OLECommandTarget 传入的参数。

CustomOut
Object

必需。 SafeArray 中由 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  

适用于