i want to have abutton that users click and then browse for file
i found this
Attachment: filefinder.zip, which is basically this:
Dim OFN As OPENFILENAME
On Error GoTo Err_BtnLocateImport_Click
' Set options for dialog box.
With OFN
.lpstrTitle = "Locate Import File"
If Not IsNull(LocateFile) Then .lpstrFile = LocateFile
.flags = &H1804 ' OFN_FileMustExist + OFN_PathMustExist + OFN_HideReadOnly
.lpstrFilter = MakeFilterString("Specific File Types (*.xls)", "*.xls", _
"All files (*.*)", "*.*")
End With
If OpenDialog(OFN) Then
LocateFile = OFN.lpstrFile
'[imgPicture].Picture = [PicFile]
'SysCmd acSysCmdSetStatus, "Afbeelding: '" & LocateFile & "'."
End If
Exit Sub
it is a good start, but i also want to specify the path (directory) that should be default where to start browsing.
ie: i know that the file should be saved in f:\mailing\current, i want it to open to that directory. (i know it opens to the last directory i was opened to)
and i want it to display by creation date descending.
any ideas?
i found this
Attachment: filefinder.zip, which is basically this:
Dim OFN As OPENFILENAME
On Error GoTo Err_BtnLocateImport_Click
' Set options for dialog box.
With OFN
.lpstrTitle = "Locate Import File"
If Not IsNull(LocateFile) Then .lpstrFile = LocateFile
.flags = &H1804 ' OFN_FileMustExist + OFN_PathMustExist + OFN_HideReadOnly
.lpstrFilter = MakeFilterString("Specific File Types (*.xls)", "*.xls", _
"All files (*.*)", "*.*")
End With
If OpenDialog(OFN) Then
LocateFile = OFN.lpstrFile
'[imgPicture].Picture = [PicFile]
'SysCmd acSysCmdSetStatus, "Afbeelding: '" & LocateFile & "'."
End If
Exit Sub
it is a good start, but i also want to specify the path (directory) that should be default where to start browsing.
ie: i know that the file should be saved in f:\mailing\current, i want it to open to that directory. (i know it opens to the last directory i was opened to)
and i want it to display by creation date descending.
any ideas?