Sub EnteteWord_BIS()
Dim strPath$, SrcePath$, Fichier$
strPath = ThisWorkbook.Path & "\": Fichier = strPath & "Essai.docx"
Set WordApp = CreateObject("Word.Application"): WordApp.Visible = True
Set WordDoc = WordApp.Documents.Open(Fichier)
Sheets(1).Range("A1:C2").Copy
With WordDoc.Sections(1).Headers(1).Range.Tables(1)
.Cell(1, 1).Range.Text = Sheets(1).Range("A1")
.Cell(1, 2).Range.Text = Sheets(1).Range("B1")
.Cell(1, 3).Range.Text = Sheets(1).Range("C1")
.Cell(2, 1).Range.Text = Sheets(1).Range("A2")
.Cell(2, 2).Range.Text = Sheets(1).Range("B2")
.Cell(2, 3).Range.Text = Sheets(1).Range("C2")
End With
End Sub
Sub EnteteWord_TER()
Dim strPath$, SrcePath$, Fichier$
strPath = ThisWorkbook.Path & "\": Fichier = strPath & "Essai.docx"
Application.ScreenUpdating = False
Set WordApp = CreateObject("Word.Application"): WordApp.Visible = False
Set WordDoc = WordApp.Documents.Open(Fichier)
WordDoc.Sections(1).Headers(1).Range.Delete
Sheets(1).Range("A1:C2").Copy
WordDoc.Sections(1).Headers(1).Range.PasteExcelTable LinkedToExcel:=0, WordFormatting:=0, RTF:=-1
Application.CutCopyMode = False
WordDoc.Close True
WordApp.Quit
Set WordApp = Nothing
End Sub