Search code examples
c#visual-studio-2022office-addinsvisio

Create a dockable window in Visio


I created a Visio Add-In in Visual Studio 2022. I need create a dockable window, however i can't see a way for create it.

Right now the only way I found was via a window form like:

myCustomForm = new Form();
myCustomForm.Text = "My (not) Integrated Window."
myCustomForm.Show();

but I'm not satisfied.

I also followed (without success) this:

https://learn.microsoft.com/it-it/office/vba/api/Visio.Windows.Add

Does anyone have any suggestions?


Solution

  • The method you point out in the question is the correct one. That is, you should use Window.Windows.Add to add dockable windows in Visio. Please share the issue you are facing when trying to use it.

    There is also a project template (installable via Visual Studio "extensions" menu) with dockable window out of the box I've created many years ago, bit it should still be functional (i.e. works fine with VS2022 and the latest Visio version), you can check it out here: https://marketplace.visualstudio.com/items?itemName=NikolayBelyh.ExtendedVisioAddinProject2017

    If you decide to go with it, don't forget to give me a star :)

    The source code is open on the GitHub (please check the above link for it)