共用方式為


Commands.Raise 方法

執行指定命令。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
Sub Raise ( _
    Guid As String, _
    ID As Integer, _
    <OutAttribute> ByRef CustomIn As Object, _
    <OutAttribute> ByRef CustomOut As Object _
)
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
)
abstract Raise : 
        Guid:string * 
        ID:int * 
        CustomIn:Object byref * 
        CustomOut:Object byref -> unit 
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

.NET Framework 安全性

請參閱

參考

Commands 介面

EnvDTE 命名空間