locked
How can I create a new document window? RRS feed

  • Question

  • Essentially, I'd like to invoke the same behavior as if one clicked "Window->New Window" from the menu bar of the Editor.

    Also, invoke "New Vertical Tab Group' behavior from the context window of any given (tabbed) document window.


    Glenn Puchtel

    Saturday, June 6, 2015 11:53 AM

Answers

  • Hi,

    You can invoke a Visual Studio command (such as "Window.NewWindow", "Window.NewVerticalTabGroup") either by name (EnvDTE.DTE.ExecuteCommand(commandFullName) method) or guessing the command guid/id. See:

    HOWTO: Execute a command by Guid and Id from a Visual Studio add-in.
    http://www.visualstudioextensibility.com/articles/add-ins/

    HOWTO: Execute a command by Guid and Id from a Visual Studio package.
    http://www.visualstudioextensibility.com/articles/packages/


    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

    Saturday, June 6, 2015 1:02 PM