Customize document type filter in wdFileOpen Dialog

J

James Coulter

Hi, is there a way to customize which file types are displayed in the
drop-down list of Word's built-in file open dialog?

I am writing an application in which I need to restrict the selection of a
file to Word templates only (*.dot, *.dotm)

The dialog does not appear to expose a Filter property, like the
CommonFileDialog.

Many thanks
 
J

Jean-Guy Marcil

James Coulter said:
Hi, is there a way to customize which file types are displayed in the
drop-down list of Word's built-in file open dialog?

I am writing an application in which I need to restrict the selection of a
file to Word templates only (*.dot, *.dotm)

The dialog does not appear to expose a Filter property, like the
CommonFileDialog.

This will get all templates to display, including the *.dotx type.
I am not sure if there is a way to make Word display only the *.dot and the
*.dotm files.


With Dialogs(wdDialogFileOpen)
.Name = "*.dot*"
Select Case .Display
Case -2
MsgBox "Close button pressed."
Case -1
MsgBox "OK Button pressed."
MsgBox .Name
Case 0
MsgBox "cancel button pressed."
End Select
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top