Hopefully not a biggie: she's getting a herniated disc repaired.
Okay, unfortunately I didn't take great notes, but I think this was all the
changes that were required.
1) Open MDialogHook.bas in Notepad, copy everything except the first line
(Attribute VB_Name = "MDialogHook") to the clipboard and paste it into a new
module. (If you've already got Option Explicit in the module, don't copy
that line from MDialogHook.bas either)
2) Find the line in DialogHookProc that says
Call SendMessage(hLV, WM_COMMAND, ByVal FCIDM_SHVIEW_REPORT,
ByVal 0&)
and change it to
Call SendMessage(hLV, WM_COMMAND, ByVal
FCIDM_SHVIEW_THUMBNAIL, ByVal 0&)
3) Save the module (may as well call it MDialogHook)
4) Open frmCommonDialogs.frm in Notepad and copy what comes after the 5
lines that start "Attribute" up to (but not including) the line Private Sub
Command1_Click() to the clipboard and paste it into a new module. (Again, if
you've already got Option Explicit in the module, don't copy that line from
frmCommonDialogs.frm either)
5) In routine GetSaveAsName, find the code
If ckUseHook.Value = vbChecked Then
.Flags = .Flags Or OFN_ENABLEHOOK
.lpfnHook = ReturnProcAddress(AddressOf MDialogHook.DialogHookProc)
End If
and remove the If construct, leaving
.Flags = .Flags Or OFN_ENABLEHOOK
.lpfnHook = ReturnProcAddress(AddressOf MDialogHook.DialogHookProc)
6) In routine GetOpenName, find the code
If ckUseHook.Value = vbChecked Then
.Flags = .Flags Or OFN_ENABLEHOOK
.lpfnHook = ReturnProcAddress(AddressOf MDialogHook.DialogHookProc)
End If
and remove the If construct, leaving
.Flags = .Flags Or OFN_ENABLEHOOK
.lpfnHook = ReturnProcAddress(AddressOf MDialogHook.DialogHookProc)
To call the FileOpen dialog, use code like:
Dim sFile As String
sFile = GetOpenName(CurrentProject.Path)
If Len(sFile) = 0 Then sFile = "No file selected."
MsgBox sFile, vbExclamation, "GetOpenFileName"
To call the FileSaveAs Dialog, use code like:
Dim sFile As String
sFile = GetSaveAsName("This File Name", CurrentProject.Path)
If Len(sFile) = 0 Then sFile = "No file selected."
MsgBox sFile, vbExclamation, "GetSaveFileName"
Hopefully that's enough to get you going. You might want to add bits from
Ken's code (what you got at
http://www.mvps.org/access/api/api0001.htm) to
give you additional functionality (such as specifying file extensions of
interest and the like)