Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim pRep$, L#
Dim wdApp As Object, wdDoc As Object
L = Target.Row
If Target.Column <> 6 Or Target.Row < 13 Or Cells(L, 1) = "" Then Exit Sub
If Target <> "" Then
If MsgBox("remplacer ?", vbYesNo) = vbNo Then Exit Sub
End If
pRep = ActiveWorkbook.Path & "\Fiches\"
Set wdApp = CreateObject("Word.application")
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Open(pRep & "Modèle.doc")
With wdDoc
.Bookmarks("ENTREPRISE").Range.Text = Cells(L, 1)
.Bookmarks("CONTACT").Range.Text = Cells(L, 3)
.Bookmarks("SERVICE").Range.Text = Cells(L, 4)
.Bookmarks("ADRESSE").Range.Text = Cells(L, 5)
.SaveAs pRep & Cells(L, 1) & Format(VBA.Date, "dd-mm-yy") & ".doc"
.Close
End With
wdApp.Quit
Set wdDoc = Nothing
Set wdApp = Nothing
Cells(L, 6) = VBA.Date
End Sub