これは、「ログ ペイン」を作成してコントロールをロードするサンプル コードです。クラスの新しいプロパティとして定義されているThisAddin.cs
ため、次の方法で呼び出すことができますGlobal.ThisAddin.LogPane
private OfficeTools.CustomTaskPane _logPane;
public OfficeTools.CustomTaskPane LogPane
{
get
{
if(_logPane==null)
{
//my winforms component to load into the pane
var logViewerComp = new LogViewerComp();
_logPane = CustomTaskPanes.Add(logViewerComp, "Log Pane");
//makes the log component fill the all pane size
logViewerComp.Dock = DockStyle.Fill;
//sets the opening position of the pane into PPT view
_logPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionBottom;
//does something when the pane shows/hides
//in this case refreshes the Ribbon to enable/disable
//the toggle button status related to the pane
_logPane.VisibleChanged += (snd, ev) =>
{
Ribbon.Reload();
};
}
return _logPane;
}
}
注: ペインを作成すると、それはすべてのアプリに属し、ユーザーが開くすべてのプレゼンテーション間で共有されます。