Compléments pour Microsoft Access

http://access.fr.free.fr/

Ouvrir fichier Word (Automation)

Description 

Cette fonction permet d'ouvrir un fichier Word.

Remarque : Pour fonctionner, il faudra rajouter la référence "Microsoft Word x.xx Object Library".

 
Synthaxe 

OpenFileWord (strDirFile)

La synthaxe de la fonction OpenFileWord comprend l'élément suivant :

ElémentsDescription

strDirFile

Expression de chaîne correspondant au chemin complet et au nom du fichier Word que l'on souhaite ouvrir.
 
Exemple 

Aucun exemple disponible pour le moment.

 
Code de la fonction 


Function OpenFileWord(strFile As String)

Dim wdApp As Word.Application

Set wdApp = CreateObject("Word.Application")

With wdApp
    .Documents.Open strFile
    .Visible = True
End With

Set wdApp = Nothing

End Function