Re: open file dialog - late binding



The code you posted is a Windows API call. It is not a library object, so "late binding" doesn't apply.

The API call is still the most reliable way to do this. Here's the one that many of us use:
http://www.mvps.org/access/api/api0001.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"ARC" <andy@xxxxxxxxx> wrote in message
news:s4VBi.7527$924.3245@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello all,

I have the following code in my app, which opens the older windows open-file dialog. Anyone know what code to use to the the more modern open file dialog? If is just a matter of chaning the "comdlg32.dll" bit, and the rest of the code will work as is? What is the new .dll?


Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
Declare Function GetSaveFileName Lib "comdlg32.dll" Alias _
"GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
Dim lngStartTime As Long
Public Const Lite_Ver = 0
Type MSA_OPENFILENAME
' Filter string used for the Open dialog filters.
' Use MSA_CreateFilterString() to create this.
' Default = All Files, *.*
strFilter As String
' Initial Filter to display.
' Default = 1.
lngFilterIndex As Long
' Initial directory for the dialog to open in.
' Default = Current working directory.
strInitialDir As String
' Initial file name to populate the dialog with.
' Default = "".
strInitialFile As String
strDialogTitle As String
' Default extension to append to file if user didn't specify one.
' Default = System Values (Open File, Save File).
strDefaultExtension As String
' Flags (see constant list) to be used.
' Default = no flags.
lngFlags As Long
' Full path of file picked. When the File Open dialog box is
' presented, if the user picks a nonexistent file,
' only the text in the "File Name" box is returned.
strFullPathReturned As String
' File name of file picked.
strFileNameReturned As String
' Offset in full path (strFullPathReturned) where the file name
' (strFileNameReturned) begins.
intFileOffset As Integer
' Offset in full path (strFullPathReturned) where the file extension begins.
intFileExtension As Integer
End Type
Const ALLFILES = "All Files"
Global Const ProgMode = 0 'ProgMode of -1 indicates this program can only be ran as a demo and cannot be registered
Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As Long
nMaxCustrFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustrData As Long
lpfnHook As Long
lpTemplateName As Long
End Type

.



Relevant Pages

  • Re: finding how much the file system is full, from a C program?
    ... If string is a null pointer, the system function determines whether the host ... The fopen function opens the file whose name is the string pointed to by filename, and associates a stream with it. ... wb truncate to zero length or create binary file for writing ...
    (comp.lang.c)
  • Re: Command button to open form and find record
    ... Opens the form if it is not already open. ... Public Function OpenFormTo(strForm As String, strWhere As String, Optional bGotoNewRecord As Boolean, _ ... Optional strOpenArgs As String) As Boolean ... Public Function HasProperty ...
    (microsoft.public.access.forms)
  • Re: Passing Form input to stored procedure to populate a report
    ... opens the form or report and pass them to an array vaiable, ... Public astrParamsAs String ... Dim stDocName As String ... The form/report opens ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Passing Form input to stored procedure to populate a report
    ... opens the form or report and pass them to an array vaiable, ... Public astrParamsAs String ... Dim stDocName As String ... The form/report opens ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Parameters from a form
    ... opens the form or report and pass them to an array vaiable, ... Public astrParamsAs String ... Dim stDocName As String ... The form/report opens ...
    (microsoft.public.access.adp.sqlserver)