1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| 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 Declare Function GetActiveWindow Lib "user32" () As Long
Private Const SW_SHOW = 5
Public Sub OpenFindFile(Optional pFolder As String, Optional pFile As String, Optional pFindIn As String)
Call ShellExecute(GetActiveWindow, "find", pFolder, vbNullString, vbNullString, SW_SHOW)
If pFile <> "" Then
SendKeys pFile, True
End If
If pFindIn <> "" Then
SendKeys "{TAB}" & pFindIn, True
End If
End Sub
Private Sub Command1_Click()
mon_numero = "1"
OpenFindFile "D:\monoutil", "*" & mon_numero & "*", "caractères" ' tu changes ici, bien évidemment "D:\Monoutil" par le répertoiire de ton choix
' qui peut par exemple être "C:\"
SendKeys "%R"
End Sub |
Partager