FileDialog box

M

Malik Al-Amin

Hi all,

When using the filedialog box to allow a user to select a word document to
open, how do you use the value that they selected and open the document? I
don't think the filedialog has a "filename" property that I can leverage. Is
this correct?

Thanks

Malik
 
D

Dave Lett

Hi Malik,

You don't need to retrieve the filename that they selected. All you really
need is the .Show method. It executes the user's actions in a dialog box.

With Dialogs(wdDialogFileOpen)
.Show
End With

HTH,
Dave
 
M

Malik Al-Amin

Hi Dave,

Thanks for the feedback.
This is the code that I have in the ShowFileDialog:

Sub ShowFileDialog()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = True
.Show
End With
End Sub

the .show method opens the dialog box but if I click on a file that file
doesn't open. Do I have to explicitly open it and if so how do I pass the
same name the user selected?

Thanks

Malik
 

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