Can one Filter File types in wdDialogFileOpen?

T

toolmaker

I'd like to filter the file selection in the wdDialogFileOpen dialog. I know
you can do it in MSO File Dialogs, but I can't find a way to do it with the
Word dialog.

Any ideas?
 
A

Anand.V.V.N

Hi toolmake hope this follwing code helps you

With Dialogs(wdDialogFileOpen)
.Name = "*.*"
.Show
End With

I tried adn it works perfectly
Anand
 
T

toolmaker

Hi Anand:

Thanks for your help. I had stumbled across the same solution last night,
but then found a new problem: wdDialogFileOpen can't handle opening multiple
files.

I decided to use the msoFileDialogOpen instead, which caused a third odd
problem. It kept re-Showing my hidden form as well as the dialog. I decided
I had to unload the form first so that it wouldn't come back uninvited.

Here's the code. If you have any suggestions, please do pass them on:

Private Sub btnSelectFiles_Click()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogOpen)
Unload frmBTS_Tables
With fd
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "All files", "*.*"
.Filters.Add "Tables", "*.tbl", 1
End With
If fd.Show = -1 Then
fd.Execute
btsTableToDoc
Else
MsgBox ("BTS Convert Tables will now quit.")
Exit Sub
End If
End Sub

N.C. Gordon ("Toolmaker")
 
A

Anand.V.V.N

Hi toolmaker,

I don't know if this would help, would it possible to create your own dialog
box in a form and display it everytime, that's actualyl very easy. That
should solve the problems.

In one situatuion, not similar to yours though, I created my own dislog box
uisng a form in vb, and not face such problems. I used the dirve list box,
file list box and the other dir list box to do it.


You done some code in vb?

Hope this was of some help.

Anand
 
A

Anand.V.V.N

Tyr this one, may be it should work.

Have a command button and execute this code in the click even
Dialogs(wdDialogFileOpen).Display

If you use onlt this I think it should solve your problem.

Anand
 

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