Hiro 714
asked on
MS Access Question: how to launch file explorer
Hi Experts,
I would like to launch file explorer from MS access by clicking a button with certain path.
Would you advise me?
I would like to launch file explorer from MS access by clicking a button with certain path.
Would you advise me?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Depends on what you want to do. If you want to select a file to be used by your application, or select a folder to be used to store a file you are exporting from your applicaiton, you will need to use the FileDialog object. There are numerous examples here in EE about how to use the FileDialog feature. I suggest you search on that term.
Very valid point Dale!
If this is to allow the user to select a file and return the filename to the application, then you should be looking at using the FileDialog, see: https://www.devhut.net/201 6/10/04/la te-binding -the-filed ialog/
If this is to allow the user to select a file and return the filename to the application, then you should be looking at using the FileDialog, see: https://www.devhut.net/201
By using the Shell method:
E.g. as method do handle the path escaping:
Shell "explorer.exe ""C:\Temp\"""
E.g. as method do handle the path escaping:
Option Compare Database
Option Explicit
Public Sub ExplorerOpenDirectory(ByVal CPath As String)
Const DELIMITER As String = """"
Const EXPLORER As String = "explorer.exe ""?"""
Shell Replace(EXPLORER, "?", Replace(CPath, DELIMITER, DELIMITER & DELIMITER)), vbNormalFocus
End Sub
And here a Windows API variation : http://access.mvps.org/access/api/api0001.htm