Actual open a file using a Filedialog box

D

Dave K.

I have the following code in the on click event procedure for a toggle button.

Dim dlgOpen As FileDialog

Set dlgOpen = Application.FileDialog(DialogType:=msoFileDialogOpen)

With dlgOpen
.AllowMultiSelect = True
.Show
End With

End Sub

I want to actually open a file when I clck the open button in the dialog box
not return the file file path.
 
J

Jack Leach

Get the path of the file as you are doing now and then send it through the
ShellExecute API (as can be found at mvps.org/access in their API section)

hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
D

Douglas J. Steele

Or, assuming that the full path to the selected file is stored in a variable
strFile, use

Application.FollowHyperlink strFile
 

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