hhhp2004
Messages postés173Date d'inscriptionsamedi 25 octobre 2003StatutMembreDernière intervention13 octobre 2007 30 déc. 2004 à 17:07
hhhp2004
salut,
je ne comprends pas DARKSIDIOUS, la fonction shell a juste 2 parametres: le chemin du programme a etre executé et le type de feneitre quon veut que le programme a lors de l'execution .... je ne vois pas ou on pourrait mettre le chemin du fichier a ouvrir avec notepad...... pourrais tu donner un exemple SVP
voici ce que jai fait
const cheminProg as string = "c:\windows\notepad.exe"
const cheminFichierTxt as string = "c:\unfichier.txt"
if dir(cheminFichierTxt) <> "" then
shell cheminProg, vbnormalfocus
end if
ou je pourrai mettre le cheminFichierTxt pour que notepad ouvre le fichier txt ?
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013130 30 déc. 2004 à 17:23
Ah, tu n'as pas l'habitude des lignes de commandes, voilà tout : il faut concaténer le nom de l'éxécutable avec le fichier à ouvrir en les séparant d'un espace :
Private Sub Form_Load()
Const cheminProg As String = "c:\windows\notepad.exe"
Const cheminFichierTxt As String = "c:\unfichier.txt"
If Dir(cheminFichierTxt) <> "" Then
Shell cheminProg & " " & cheminFichierTxt, vbNormalFocus