Sub CreerOuvrirWord()
Dim NomDoc As String
Dim Chemin As String
Dim appWD As Word.Application
Dim oDoc As Word.Document
nom = Cells(ActiveCell.Row, 3) & " " & " "
NomDoc = nom & ".doc"
If Len(nom) = 1 Then Exit Sub 'si la ligne ne contient ni nom ni prénom on quitte
Chemin = ActiveWorkbook.Path & "\Mon Fichier Clients\" & NomDoc 'à adapter ici répertoire courant
On Error Resume Next
Set appWD = CreateObject("Word.Application")
If Err.Number <> 0 Then
Set appWD = CreateObject("Word.Application")
End If
On Error GoTo 0
If Dir(Chemin) <> "" Then
Set oDoc = appWD.Documents.Open(Chemin)
Else
Set oDoc = appWD.Documents.Add
With oDoc
With .Sections(1).Headers(wdHeaderFooterPrimary).Range 'ajout d'un en-tête contenant le nom
.Font.Bold = True 'en gras
.Font.Italic = True 'en italique
.Text = "Fiche de soin de " & nom
End With
.SaveAs Chemin
End With
End If
appWD.Visible = True
appWD.Activate
End Sub