Impossible d'ouvrir une page htm depuis un bouton en vb

tentouz Messages postés 1 Date d'inscription mercredi 13 avril 2005 Statut Membre Dernière intervention 16 avril 2005 - 16 avril 2005 à 06:09
cboulas Messages postés 2641 Date d'inscription mercredi 2 juin 2004 Statut Membre Dernière intervention 8 janvier 2014 - 16 avril 2005 à 11:24
Salut voila mon premier post, je suis débutant en vb et j'aimerais ouvrir la page: mapage.htm
depuis un bouton,voici mon code:
______________________________________
Private Sub ports_Click()
Shell App.Path & "\mapage.htm", vbNormalFocus
End Sub
______________________________________
à l éxecution---->
erreur d'execution "5":
argument ou appel de procedure incorrect

Alors que si je remplace mapage.HTM par mapage.EXE(en renomant le nom du fichier de la page et dans le code en *.exe), ca fonctionne! ... il l'execute! .......?
Si vous pourriez m'aider svp.Merci d'avance pour vos reponses.
@+

1 réponse

cboulas Messages postés 2641 Date d'inscription mercredi 2 juin 2004 Statut Membre Dernière intervention 8 janvier 2014 16
16 avril 2005 à 11:24
Salut, utilise plutôt cett méthode :

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

sub Commandbutton()
Dim FileStr As String
FileStr = "http://www.microsoft.com/France"
ShellExecute Me.hwnd, vbNullString, FileStr, "", vbNullString, 1
end sub


Chris...
Web : Firstruner - eMail : [mailto:support@firstruner.com Support]&nbs
0
Rejoignez-nous