What is the best way to get a Common Dialog in Access 2000 Standard Edition?
Microsoft suggests this:
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter 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
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
(See: http://support.microsoft.com/default...b;en-us;303066)
In Access 2003 I was using this:
Private Sub Browse(strTag As String)
Dim dDialog As Office.FileDialog
Dim varDir As Variant
Set dDialog = Application.FileDialog(msoFileDialogFolderPicker)
dDialog.AllowMultiSelect = False
dDialog.Title = " Select Directory"
If dDialog.Show = True Then
For Each varDir In dDialog.SelectedItems
Me!txtPath = varDir
Next
End If
End Sub
Do I need MS's private function?
Thanks in advance.