VB Executer un fichier Word *.dot

Résolu
michelroc Messages postés 84 Date d'inscription lundi 19 mai 2003 Statut Membre Dernière intervention 2 janvier 2010 - 22 oct. 2008 à 18:24
PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 - 22 oct. 2008 à 18:35
Bonjour,

Je recherche la syntaxe pour ouvrir un fichier word  *.DOT 

Shell .. "c:\................

Merci

A+

Michel [:)]

1 réponse

PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
22 oct. 2008 à 18:35
salut,


'    OUVRIR UN DOCUMENT /
LANCER UN EXECUTABLE
'    http://www.codyx.org/snippet_ouvrir-document-lancer-executable_25.aspx#1548
'    Posté par [ PCPT ] le 05/11/2007
<hr />




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


Public Sub 
StartProcess(
ByVal 
sFile 
As String
,

Optional ByVal
sParameters
As String

= vbNullString)

    ShellExecute 0&, "open", sFile, sParameters, vbNullString, 1&
End Sub
'
'
'
=====
' EXEMPLE
' =======
'
Private Sub Form_Load()
    StartProcess "C:\mon_image.jpg" '<- ouvre l'image avec ACDSEE par
exemple
    StartProcess "N:\Mon dossier"   '<- ouvre l'explorateur à cette
arborescence
    StartProcess "D:\fichier.pdf"   '<- ouvre le fichier avec Acrobat
Reader
    StartProcess "C:\Client.exe"    '<- lance le programme
End Sub










<hr size="2" width="100%" />
Prenez un instant pour répondre à [sujet-SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp 
3
Rejoignez-nous