Option Explicit
Const ThePath As String = 'C:\Documents and Settings\Thierry\Mes documents\Test\' 'A ADAPTER
Const TheFile As String = 'Fusion.doc'
'==================================================================================
'NB Nécessite de faire référence à la Librairie 'Microsoft Word XX.0 Object Library'
'==================================================================================
Sub Ouv_Word()
Dim WrdApp As Word.Application
Dim WrdDoc As Word.Document
Set WrdApp = CreateObject('Word.Application')
On Error GoTo ErrorHandler
Set WrdDoc = WrdApp.Documents.Open(ThePath & TheFile)
WrdApp.Visible = True
Exit Sub
ErrorHandler:
If Err = 5174 Then
MsgBox 'Le fichier ' & TheFile & ' doit être placé dans le répertoire ' & ThePath, vbOKOnly + vbExclamation, 'Attention'
' Application.Quit '<<<<< ARF TU VAS TE FAIRE ENGUEULER !!!
ElseIf Err = 5273 Then
MsgBox 'Le chemin pour le Répertoire ' & ThePath & ' n'est pas correct', vbOKOnly + vbExclamation, 'Attention'
Else
MsgBox 'Erreur non gérée ' & Err.Number & ' ' & Err.Description
End If
End Sub