VB:如何选定文件或文件夹

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'测试
Private Sub Command1_Click()
    selectitem "e:\mc\mmtest.jpg"
    Sleep 10000
    selectitem "e:\mc"
End Sub

Private Sub selectitem(ByVal itempath As String)
    On Error Resume Next
    Shell "explorer /select, " + itempath, vbNormalFocus
End Sub

你可能感兴趣的:(文件夹)