using MS Office FileDialog box in Access to open a file

K

KK

How can I get Office 2000 file open
dialog box into my access application?

Currenlty I have added a reference to
MS office 10 library but can't find a way
to create an instance of fileDialog

Dim objFileDialog As Office.FileDialog
//This doesn't work cause there is no such method to get the
//reference
Set objFileDialog =
Application.FileDialog(Office.msoFileDialogFilePicker)

objFileDialog.AllowMultiSelect = False
objFileDialog.InitialFileName = GetAppPath()
objFileDialog.Filters.Add "Acrobat PDF File", "*.pdf"

Help!
KK
 
D

Dirk Goldgar

KK said:
How can I get Office 2000 file open
dialog box into my access application?

Currenlty I have added a reference to
MS office 10 library but can't find a way
to create an instance of fileDialog

Dim objFileDialog As Office.FileDialog
//This doesn't work cause there is no such method to get the
//reference
Set objFileDialog =
Application.FileDialog(Office.msoFileDialogFilePicker)

objFileDialog.AllowMultiSelect = False
objFileDialog.InitialFileName = GetAppPath()
objFileDialog.Filters.Add "Acrobat PDF File", "*.pdf"

Help!

I don't think that the FileDialog object was introduced to Access until
Access 2002. If I'm right about that, you are not going to be able to use
in Access 2000, and that's flat. However, you can call the Windows File
Open/Save Dialog API directly, using the code posted at

http://www.mvps.org/access/api/api0001.htm
 
D

Douglas J. Steele

Dirk Goldgar said:
I don't think that the FileDialog object was introduced to Access until
Access 2002. If I'm right about that, you are not going to be able to use
in Access 2000, and that's flat. However, you can call the Windows File
Open/Save Dialog API directly, using the code posted at

http://www.mvps.org/access/api/api0001.htm


Even if it is available in Access 2000 (and my recollection is the same as
yours, Dirk), it's still better to use the API approach. AFAIK, the
FileDialog object doesn't work with runtime versions, nor does the File Save
option work.
 

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