CustomTaskPaneCollection.Add メソッド (UserControl, String, Object) (2007 System)

更新 : 2007 年 11 月

新しい CustomTaskPane を作成し、現在の CustomTaskPaneCollection に追加します。カスタム作業ウィンドウは、指定された UserControl に基づき、指定されたタイトルがあり、指定されたアプリケーション ウィンドウに関連付けられています。

名前空間 :  Microsoft.Office.Tools
アセンブリ :  Microsoft.Office.Tools.Common.v9.0 (Microsoft.Office.Tools.Common.v9.0.dll 内)

構文

'宣言
Public Function Add ( _
    control As UserControl, _
    title As String, _
    window As Object _
) As CustomTaskPane
'使用
Dim instance As CustomTaskPaneCollection
Dim control As UserControl
Dim title As String
Dim window As Object
Dim returnValue As CustomTaskPane

returnValue = instance.Add(control, title, _
    window)
public CustomTaskPane Add(
    UserControl control,
    string title,
    Object window
)

パラメータ

  • title
    型 : System.String

    新しいカスタム作業ウィンドウのタイトル バーに表示されるテキスト。

  • window
    型 : System.Object

    新しいカスタム作業ウィンドウを関連付けるアプリケーション ウィンドウを表すオブジェクト。

戻り値

型 : Microsoft.Office.Tools.CustomTaskPane

新しいカスタム作業ウィンドウを表す CustomTaskPane

例外

例外 条件
ArgumentNullException

control または title が nullnull 参照 (Visual Basic では Nothing) です。

ObjectDisposedException

Dispose メソッドは既に、CustomTaskPaneCollection で呼び出されています。

解説

特定のアプリケーション ウィンドウに関連付けられている新しい CustomTaskPane を作成するには、このメソッドを使用します。このメソッドは、Outlook で複数のエクスプローラ ウィンドウやインスペクタ ウィンドウを表示したり、Word や InfoPath で複数の文書を表示したりするカスタム作業ウィンドウを作成する場合に便利です。詳細については、「複数のアプリケーション ウィンドウでカスタム作業ウィンドウを管理する」を参照してください。

window パラメータの型はアプリケーションによって異なります。次の表に、window パラメータの有効な型を示します。

アプリケーション

パラメータの型

Word 2007

Microsoft.Office.Interop.Word.Window

Excel 2007

Microsoft.Office.Interop.Excel.Window

PowerPoint 2007

Microsoft.Office.Interop.PowerPoint.DocumentWindow

InfoPath 2007

Microsoft.Office.Interop.InfoPath.WindowObject

Outlook 2007

Microsoft.Office.Interop.Outlook.Explorer

または

Microsoft.Office.Interop.Outlook.Inspector

CustomTaskPaneCollection クラスは CustomTaskPane オブジェクトのコレクションですが、Add メソッドは、CustomTaskPane オブジェクトではなく UserControl オブジェクトを受け入れます。詳細については、「カスタム作業ウィンドウの概要」を参照してください。

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

CustomTaskPaneCollection クラス

CustomTaskPaneCollection メンバ

Add オーバーロード

Microsoft.Office.Tools 名前空間

その他の技術情報

カスタム作業ウィンドウの概要

複数のアプリケーション ウィンドウでカスタム作業ウィンドウを管理する