PDA

View Full Version : VBA Open Template Dialog Box



travbod579
11-05-2008, 12:12 PM
Hello,

I am trying to open the templates dialog box using VBA but do not seem to be able to. The box I want to open can also be accessed by goinbg to File > New > General Templates (In right hand panel that appears).

I can get Word to open a dialog box to open a file using:


application.FileDialog(msoFileDialogOpen).Show

but this is not the view I need. Is there a way to achieve this?

Thanks

fumei
11-05-2008, 12:23 PM
That is the code to open File > Open.

As you want to get the templates dialog, and that is done with File > New....

Application.Dialogs(wdDialogFileNew).Show

BTW: if you wish to by-pass the Pane that displays with actually using File > New, you can re-write FileNew as:


Sub FileNew()

Application.Dialogs(wdDialogFileNew).Show
End Sub
and it will display right to the dialog.

travbod579
11-05-2008, 04:15 PM
That is brilliant thanks. Is there away to extend that so I can choose the tab it starts on within the dialog box instead of loading General everytime.

Many Thanks