0

I am new to powerpoint add in and looking to add custom task pane.

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

from Above link you can add custompane by using

  this.CustomTaskPanes.add()

I cannot find CustomTaskPanes in the intellisense when trying to do it from ribbon control click.

Any ideas?

Mandar Jogalekar
  • 3,199
  • 7
  • 44
  • 85

2 Answers2

0

The CustomTaskPanes collection is a property on the ThisAddIn class. So, you will be able to access it within the ThisAddIn_Startup method using the "this." syntax. If you're not seeing the collection in intellisense/autocomplete.

The issue may have arised due to some possibilities like :

  1. You're not using VSTO(Visual Studio Tools for Office) 2005 SE.

  2. You're using VSTO 2005 SE but you installed on top of a previous VSTO v3 CTP which was not completely removed.

  3. You're building an add-in for an application that does not support custom task panes (all the Office 2003 apps, Visio 2007).

Tharif
  • 13,794
  • 9
  • 55
  • 77
0

That's a sample code to create a "Log Pane" and load a control into it. It's defined as a new property of ThisAddin.cs class, so you can invoke it by 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;
        }
    }

Note: when you create a Pane it belongs to the all app and it is shared between all presentations the user opens.

Fabio B.
  • 970
  • 2
  • 14
  • 29