Commands.Raise 方法

更新:2007 年 11 月

执行指定的命令。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Sub Raise ( _
    Guid As String, _
    ID As Integer, _
    <OutAttribute> ByRef CustomIn As Object, _
    <OutAttribute> ByRef CustomOut As Object _
)
用法
Dim instance As Commands
Dim Guid As String
Dim ID As Integer
Dim CustomIn As Object
Dim CustomOut As Object

instance.Raise(Guid, ID, CustomIn, CustomOut)
void Raise(
    string Guid,
    int ID,
    out Object CustomIn,
    out Object CustomOut
)
void Raise(
    [InAttribute] String^ Guid, 
    [InAttribute] int ID, 
    [InAttribute] [OutAttribute] Object^% CustomIn, 
    [InAttribute] [OutAttribute] Object^% CustomOut
)
function Raise(
    Guid : String, 
    ID : int, 
    CustomIn : Object, 
    CustomOut : Object
)

参数

  • CustomIn
    类型:System.Object%

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

  • CustomOut
    类型:System.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
   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

权限

另请参见

参考

Commands 接口

Commands 成员

EnvDTE 命名空间