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 Declare Function apiFindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpclassname As Any, ByVal lpCaption As Any) As Long
Global Const SW_SHOWNORMAL = 1 -----------------------------------------------------------
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
Declare Function apiFindWindow Lib "user32"
Alias "FindWindowA" _
(ByVal lpclassname As Any, ByVal lpCaption As Any) As
Long
Global Const SW_SHOWNORMAL = 1
-----------------------------------------------------------
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 Declare Function apiFindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpclassname As Any, ByVal lpCaption As Any) As Long
Global Const SW_SHOWNORMAL = 1 -----------------------------------------------------------
End Sub -----------------------------------------------------------
L'application associé a l'extenction du fichier s'ouvrira et le fichier avec.
Cela marche bien sur pour tout type d'extenction .xls .doc .gif .bmp .jpeg .wav etc .....
Bon courage
FRED87
Fred87
Re bonjour
Autant pour moi a la deuxième lecture de ton post, je vois que je ne t'ai pas donner ta réponse.
En fait sur le clic de l'image il suffit de tester l'extenction du .picture du control image: puis faire une commande shell de ce type:
Expl: ---------------------------------------------------------- - Dim Retval Dim Extenction As Variant
Extenction = Right(Me![Image].Picture, 3)
Select Case Extenction
Case "bmp", "jpg"
If MsgBox("Voulez vous ouvrir l'image avec Ms Paint ?", vbYesNo) = vbYes Then Retval = Shell("C:Program FilesMsPaint.exe " & Me![Image].Picture, 1) Exit Sub End If
If MsgBox("Voulez vous ouvrir l'image avec Ms editor ?", vbYesNo) = vbYes Then Retval = Shell("C:Program FilesMsEditor.exe " & Me![Image].Picture, 1) Exit Sub End If
Case Else MsgBox ("Ce n'est pas un fichier image connu !!")
Autant pour moi a la deuxième lecture de ton post, je vois
que je ne t'ai pas donner ta réponse.
En fait sur le clic de l'image il suffit de tester
l'extenction du .picture du control image:
puis faire une commande shell de ce type:
Expl:
----------------------------------------------------------
-
Dim Retval
Dim Extenction As Variant
Extenction = Right(Me![Image].Picture, 3)
Select Case Extenction
Case "bmp", "jpg"
If MsgBox("Voulez vous ouvrir l'image avec Ms
Paint ?", vbYesNo) = vbYes Then
Retval = Shell("C:Program FilesMsPaint.exe " &
Me![Image].Picture, 1)
Exit Sub
End If
If MsgBox("Voulez vous ouvrir l'image avec Ms
editor ?", vbYesNo) = vbYes Then
Retval = Shell("C:Program FilesMsEditor.exe " &
Me![Image].Picture, 1)
Exit Sub
End If
Case Else
MsgBox ("Ce n'est pas un fichier image connu !!")
Autant pour moi a la deuxième lecture de ton post, je vois que je ne t'ai pas donner ta réponse.
En fait sur le clic de l'image il suffit de tester l'extenction du .picture du control image: puis faire une commande shell de ce type:
Expl: ---------------------------------------------------------- - Dim Retval Dim Extenction As Variant
Extenction = Right(Me![Image].Picture, 3)
Select Case Extenction
Case "bmp", "jpg"
If MsgBox("Voulez vous ouvrir l'image avec Ms Paint ?", vbYesNo) = vbYes Then Retval = Shell("C:Program FilesMsPaint.exe " & Me![Image].Picture, 1) Exit Sub End If
If MsgBox("Voulez vous ouvrir l'image avec Ms editor ?", vbYesNo) = vbYes Then Retval = Shell("C:Program FilesMsEditor.exe " & Me![Image].Picture, 1) Exit Sub End If
Case Else MsgBox ("Ce n'est pas un fichier image connu !!")