首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Powerpoint AddIn

Powerpoint AddIn
EN

Stack Overflow用户
提问于 2015-03-28 06:53:39
回答 2查看 170关注 0票数 0

我是新的powerpoint添加和寻找添加自定义任务窗格。

https://msdn.microsoft.com/en-us/library/Microsoft.Office.Tools.CustomTaskPane(v=vs.110).aspx

从上面的链接中,您可以使用

代码语言:javascript
复制
  this.CustomTaskPanes.add()

我无法在智能感知中找到CustomTaskPanes,当我试图通过带状控制单击它时。

有什么想法吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-03-28 07:00:51

CustomTaskPanes集合是ThisAddIn类上的一个属性。因此,您将能够使用“this”在ThisAddIn_Startup方法中访问它。语法。如果您没有看到intellisense/autocomplete中的集合。

这一问题可能是由于以下几种可能性而引起的:

  1. 您没有使用VSTO()2005SE。
  2. 您使用的是VSTO 2005 SE,但您安装在以前的VSTO v3 CTP之上,该CTP尚未完全删除。
  3. 您正在为不支持自定义任务窗格的应用程序构建外接程序(所有Office 2003应用程序,Visio 2007)。
票数 0
EN

Stack Overflow用户

发布于 2015-04-10 08:24:47

这是一个创建“日志窗格”并将控件加载到其中的示例代码。它被定义为ThisAddin.cs类的一个新属性,因此您可以通过Global.ThisAddin.LogPane调用它

代码语言:javascript
复制
    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;
        }
    }

注意:创建窗格时,它属于所有应用程序,并在用户打开的所有演示文稿之间共享。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29314568

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档