Re: open file dialog - late binding
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 23:39:14 +0800
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
.
- Follow-Ups:
- Re: open file dialog - late binding
- From: ARC
- Re: open file dialog - late binding
- References:
- open file dialog - late binding
- From: ARC
- open file dialog - late binding
- Prev by Date: mailmerge
- Next by Date: Re: open file dialog - late binding
- Previous by thread: open file dialog - late binding
- Next by thread: Re: open file dialog - late binding
- Index(es):
Relevant Pages
|
|