以Excel插件为例:

1. ActionPane

创建 ThisWorkbook 项目

private void ThisWorkbook_Startup(object sender, System.EventArgs e)
{
  this.ActionsPane.Controls.Add(new UserControl());//添加自定义窗口
}

2.CustomTaskPane

CustomTaskPane ctp = Globals.ThisAddIn.CustomTaskPanes.Add(new UserControl1(), "导航");

ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionLeft;

ctp.Visible = true;

05-08 15:47