Excel ouvrire un fichier word
Résolu
tas6705
-
tas6705 -
tas6705 -
Bonjour,
sous VBA : Je voudrai ouvrir un fichier Word "C:\Documents and Settings\cochoum\My Document\Rapport.doc" juste en appuyant sur un commandbox.
Ps: je suis sous XP et office 2003.
Merci d'avance.
sous VBA : Je voudrai ouvrir un fichier Word "C:\Documents and Settings\cochoum\My Document\Rapport.doc" juste en appuyant sur un commandbox.
Ps: je suis sous XP et office 2003.
Merci d'avance.
A voir également:
- Excel ouvrire un fichier word
- Word et excel gratuit - Guide
- Fichier bin - Guide
- Comment réduire la taille d'un fichier - Guide
- Word 2013 - Télécharger - Traitement de texte
- Fichier epub - Guide
2 réponses
Bonsoir,
Après avoir référencé la bibliothèque :
Microsoft Word 12 Object Library dans outils / références
Saisie le code suivant :
dans la partie Général / déclarations :
Option Explicit
'Déclaration des variables
Dim wApp As Word.Application
Dim wDoc As Word.Document
créer une nouvelle procédure de type SUB :
Public Sub Ouverture_Fichier()
Set wApp = CreateObject("Word.Application")
wApp.Visible = True
'set wdoc=wapp.Documents.Open "<chemin d'access + nom du fichier>"
' autres instructions ...
End Sub
Après avoir référencé la bibliothèque :
Microsoft Word 12 Object Library dans outils / références
Saisie le code suivant :
dans la partie Général / déclarations :
Option Explicit
'Déclaration des variables
Dim wApp As Word.Application
Dim wDoc As Word.Document
créer une nouvelle procédure de type SUB :
Public Sub Ouverture_Fichier()
Set wApp = CreateObject("Word.Application")
wApp.Visible = True
'set wdoc=wapp.Documents.Open "<chemin d'access + nom du fichier>"
' autres instructions ...
End Sub