第1个回答 2013-09-27
'用ShellExecute这个api就好了
Private Declare Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long
Private Const SW_SHOWNORMAL = 1
Sub SelectFile(ByVal FilePath As String)
Dim Param As String
Param = "/select," + FilePath
ShellExecute ByVal 0, "open", "explorer.exe", Param, "", SW_SHOWNORMAL
End Sub
' SelectFile "C:\1.txt" 就会打开资源管理器,选择1这个文件。本回答被提问者采纳