1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
lngResult = 0
strBuffer = ""
Dim MAX_PATH = 260
Dim SW_SHOWNORMAL = 1
Dim Nomfich As String
Nomfich = "LienFichier"
If Dir(Nomfich) = "" Then
MsgBox("Fichier introuvable !") : Exit Sub
End If
Dim Ext As String = ""
If Nomfich <> "" Then
Ext = UCase(Right(Nomfich, 3))
If (Ext = "TXT" Or Ext = "DOC" Or Ext = "XLS" Or Ext = "CSV" Or Ext = "PDF" Or Ext = "VSD" Or _
Ext = "HTM" Or Ext = "JPG" Or Ext = "JPEG" Or Ext = "GIF" Or Ext = "BMP" Or _
Ext = "TIF" Or Ext = "JPE" Or Ext = "ICO" Or Ext = "MSG" Or Ext = "EB\" Or Ext = "EB") Then
strBuffer = Space$(MAX_PATH)
lngResult = FindExecutable(Nomfich$, "", strBuffer)
If strBuffer <> "" Then
strBuffer = Left(Nomfich, Len(Nomfich) - Len(Dir(Nomfich)))
Dim handle As Integer = ConsultationHistoriques.FindWindow(vbNullString, "CsouBotV1.1")
ShellExecute(handle, vbNullString, Nomfich, vbNullString, strBuffer, SW_SHOWNORMAL)
End If
Else
MsgBox("EXTENTION NON PERMISE : " & Ext, vbExclamation)
Exit Sub
End If
End If |
Partager