none
Are Task Panes Available in Visio? RRS feed

  • Question

  • Hi,

    I need create a dockable window for my Visio 2010 add-in, however I see no way of creating a task pane for Visio.

    Am I missing something?

    Wednesday, March 9, 2011 1:03 PM

Answers

  • Hi Mike,

    Thanks for posting in the MSDN Forum.

    I can get the custom task pane collection of Visio via this snippet, but I’m not able to add a user control to this collection. I will consult others for it.

    try
          {
            Microsoft.Office.Tools.CustomTaskPane cp;
            Microsoft.Office.Tools.CustomTaskPaneCollection cpc;
            cpc = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
            UserControl1 frm = new UserControl1();
            //Application.Documents.Add(@"C:\Users\v-yangxu\Desktop\Drawing1.vsd");
            cp = cpc.Add(frm, "test"); //it will occur exception "Value can not be null. Parameter name: o"
            cp.Visible = true;
          }
          catch (Exception ex)
          {
            MessageBox.Show(ex.Message, "Exception");
          }
    

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Borozdin Monday, March 14, 2011 8:15 AM
    Friday, March 11, 2011 7:18 AM
    Moderator

All replies

  • Hi Mike,

    Thanks for posting in the MSDN Forum.

    I can get the custom task pane collection of Visio via this snippet, but I’m not able to add a user control to this collection. I will consult others for it.

    try
          {
            Microsoft.Office.Tools.CustomTaskPane cp;
            Microsoft.Office.Tools.CustomTaskPaneCollection cpc;
            cpc = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
            UserControl1 frm = new UserControl1();
            //Application.Documents.Add(@"C:\Users\v-yangxu\Desktop\Drawing1.vsd");
            cp = cpc.Add(frm, "test"); //it will occur exception "Value can not be null. Parameter name: o"
            cp.Visible = true;
          }
          catch (Exception ex)
          {
            MessageBox.Show(ex.Message, "Exception");
          }
    

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Borozdin Monday, March 14, 2011 8:15 AM
    Friday, March 11, 2011 7:18 AM
    Moderator
  • Hi Tom,

    Thank you for answering me.

    Yes, it threw the same exception to me.

    But I didn't even know that the CreateCustomTaskPaneCollection() method was available because IntelliSence simply didn't show me it.

    Friday, March 11, 2011 8:44 AM
  • Hello Tom,

    Did you have a chance to resolve the above exception?

    I need to add custom task pane to my VISIO addin.

    Thanks

    Alaa

    Tuesday, August 9, 2011 2:50 PM
  • Unless there is some sort of work around that I am unaware of, custom task panes are not supported for Visio. The following MSDN article lists UI features (including custom task panes) that are supported by various Office applications - http://msdn.microsoft.com/en-us/library/bf08984t.aspx.


    Norm Estabrook
    Tuesday, August 9, 2011 6:50 PM
    Answerer
  • Thanks Norm for the update.

    Has a workaround been reported?

    Alaa

    Tuesday, August 9, 2011 9:16 PM