Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
ng
Salut,
Essai ceci :
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 Const SW_SHOWNORMAL = 1
Private Sub Form_Load() Dim sCheminComplet as String sCheminComplet = "c:..." ShellExecute Me.hwnd, "open" , sCheminComplet , vbNullString, "C:", SW_SHOWNORMAL End Sub
Nicolas. -- http://www.ngsoft-fr.com "Patrick FREDIN" a écrit dans le message de news: 07ca01c3cf12$c4092340$
Bonjour,
Dans un champ d'une table j'ai le nom complet d'un fichier (path + nom) pour chaque enregistrement. Le type est inconnu (Word, Excel, PDF, ...).
En cliquant sur un bouton je souhaite ouvrir ce fichier. Quel code VB dois-je utiliser ?
Merci d'avance.
Patrick
Salut,
Essai ceci :
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
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
Dim sCheminComplet as String
sCheminComplet = "c:..."
ShellExecute Me.hwnd, "open" , sCheminComplet , vbNullString, "C:",
SW_SHOWNORMAL
End Sub
Nicolas.
--
http://www.ngsoft-fr.com
"Patrick FREDIN" <fredin@magic.fr> a écrit dans le message de news:
07ca01c3cf12$c4092340$a001280a@phx.gbl...
Bonjour,
Dans un champ d'une table j'ai le nom complet d'un fichier
(path + nom) pour chaque enregistrement. Le type est
inconnu (Word, Excel, PDF, ...).
En cliquant sur un bouton je souhaite ouvrir ce fichier.
Quel code VB dois-je utiliser ?
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 Const SW_SHOWNORMAL = 1
Private Sub Form_Load() Dim sCheminComplet as String sCheminComplet = "c:..." ShellExecute Me.hwnd, "open" , sCheminComplet , vbNullString, "C:", SW_SHOWNORMAL End Sub
Nicolas. -- http://www.ngsoft-fr.com "Patrick FREDIN" a écrit dans le message de news: 07ca01c3cf12$c4092340$
Bonjour,
Dans un champ d'une table j'ai le nom complet d'un fichier (path + nom) pour chaque enregistrement. Le type est inconnu (Word, Excel, PDF, ...).
En cliquant sur un bouton je souhaite ouvrir ce fichier. Quel code VB dois-je utiliser ?
Merci d'avance.
Patrick
Pierre Alexis [MVP]
Salut Patrick,
Tu as écrit :
Dans un champ d'une table j'ai le nom complet d'un fichier (path + nom) pour chaque enregistrement. Le type est inconnu (Word, Excel, PDF, ...).
En cliquant sur un bouton je souhaite ouvrir ce fichier. Quel code VB dois-je utiliser ?
Réponse sur la FAQ ;-) :
Question 8 - Comment ouvrir un fichier à partir d'une application VB ? http://faq.vb.free.fr/index.php?question=8