Show File->New in MS Word 365 using VSTO

Shakas 1 Reputation point
2022-09-19T02:52:16.637+00:00

Hello,
I want to display the template folder in MS Word, using VSTO/C#, as if the user clicked on File-> New using MS Office 365 and the Personal templates are displayed on the screen. I'm using VSTO in VS 2022. With the C# code Application.Dialogs[WdWordDialog.wdDialogFileNew].Show(), it brings up the old/legacy new template dialog. How do I get to the new Word/office 365 New-> File dialog? Please advise.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,532 questions
Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
896 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shakas 1 Reputation point
    2022-09-20T01:55:02.467+00:00

    Hello,
    Added the below code and it seems to work.

    Object oMissing = System.Reflection.Missing.Value;
    Application app = new Application();
    Document doc = app.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    app.Visible = true;
    app.CommandBars.ExecuteMso("FileNew");

    Thanks!