我是新的powerpoint添加和寻找添加自定义任务窗格。
https://msdn.microsoft.com/en-us/library/Microsoft.Office.Tools.CustomTaskPane(v=vs.110).aspx
从上面的链接中,您可以使用
this.CustomTaskPanes.add()我无法在智能感知中找到CustomTaskPanes,当我试图通过带状控制单击它时。
有什么想法吗?
发布于 2015-03-28 07:00:51
CustomTaskPanes集合是ThisAddIn类上的一个属性。因此,您将能够使用“this”在ThisAddIn_Startup方法中访问它。语法。如果您没有看到intellisense/autocomplete中的集合。
这一问题可能是由于以下几种可能性而引起的:
发布于 2015-04-10 08:24:47
这是一个创建“日志窗格”并将控件加载到其中的示例代码。它被定义为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;
}
}注意:创建窗格时,它属于所有应用程序,并在用户打开的所有演示文稿之间共享。
https://stackoverflow.com/questions/29314568
复制相似问题