using MS Office FileDialog box in Access to open a file

  • Thread starter Thread starter KK
  • Start date Start date
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
 
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
 
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.
 
Back
Top