Salut,
voici la fonction pour faire ça; mets là dans un module.
Public Const SW_SHOW = 1
Public 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
Public Sub DemarrerAppURL(frm As Form, ByVal WebPageURLorFileName As String)
'
' Pris de l'Internet, utiliser comme suit:
'
' Call DemarrerAppURL(Me, "http://www.vbthunder.com") Pour un site web OU
' Call DemarrerAppURL(Me, "C:\MyPath\testdoc.doc") Pour ouvrir un fichier X
'
' Fonctionne avec tout fichier ayant une application associée.
'
Dim hBrowse As Long
hBrowse = ShellExecute(frm.hwnd, "open", WebPageURLorFileName, "", "", SW_SHOW)
End Sub
La prochaine fois, pense à faire une petite recherche sur le site avant de poster, il y a (presque) toutes les sources pour débutant et intermédiaire. ;)
--------------------------------------------------------------------------
Parrainage pour Prizee (gagner de l'argent), un clic n'engage à rien.
http://www.prizee.com/?refer=Benoitp59