Commands2.Raise(String, Int32, Object, Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
执行指定的命令。
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
必需。 OLECommandTarget 的 in 参数。
- CustomOut
- Object
必需。 OLECommandTarget 的 out 参数。
实现
- 属性
示例
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