0

I am using the following command in Word VBA but in the latest version of Word 365 (version 2005):

Application.CommandBars.ExecuteMso ("FileNew")

but this does not give the same Backstage page as clicking File > New.

When you click File > New you get the choice of Office and Personal templates but the ExecuteMso ("FileNew") does not display the Personal templates.

Any ideas on how to get Backstage page as per clicking File > New? I can't use SendKeys because command has to work in multiple languages and ribbon is language specific.

braX
  • 11,506
  • 5
  • 20
  • 33
  • Why do you need to execute code to show the Backstage view? There is a built-in command to do just that, though it isn't on the ribbon, New From Template (FileNew). There are registry settings to remove the Office/Featured templates from the Backstage view and set the default tab. – Timothy Rylatt Jun 23 '20 at 15:07

2 Answers2

0

Use Documents.Add which allows you to specify the template, or Application.Dialogs(wdDialogFileNew) which allows you to choose the template.

macropod
  • 12,757
  • 2
  • 9
  • 21
  • Thanks but the client wants to see the Backstage view of New to select a template. It's frustrating that Microsoft make these type of annoying little changes for no good reason (other than to promote their templates, which are of no interest or benefit in a corporate environment) – David Price Jun 23 '20 at 14:19
0

Most probably you need to activate the File tab programmatically first. The IRibbonUI.ActivateTabMso method activates the specified built-in tab. Read more about that in the Ribbon Extensibility in Office 2010: Tab Activation and Auto-Scaling article.

Only then you can run the built-in command - FileNew.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45