Dim traitementTexte As Word.Application
Set traitementTexte = New Word.Application
Dim u As String
traitementTexte.Visible = True
Dim leDoc As Document
Set leDoc = traitementTexte.Documents.Open(ActiveWorkbook.Path & "/TON FICHIER WORD.doc")
leDoc.Content.Find.Execute FindText:="<BALISE1>", ReplaceWith:=Feuil8.Range("B1").Value, Replace:=WdReplaceAll
leDoc.Content.Find.Execute FindText:="<BALISE2>", ReplaceWith:=Feuil8.Range("B3").Value, Replace:=WdReplaceAll
leDoc.Content.Find.Execute FindText:="<BALISE3>", ReplaceWith:=Date, Replace:=WdReplaceAll
Feuil8.Range("B5").Value = UCase(Feuil8.Range("B5").Value)
leDoc.Content.Find.Execute FindText:="<BALISE4>", ReplaceWith:=Feuil8.Range("B5").Value, Replace:=WdReplaceAll
u = Feuil8.Range("B6").Text
u = UCase(u)
leDoc.Content.Find.Execute FindText:="<BALISE5>", ReplaceWith:=u, Replace:=WdReplaceAll
leDoc.Content.Find.Execute FindText:="<BALISE6>", ReplaceWith:=Feuil8.Range("B7").Value, Replace:=WdReplaceAll
Feuil8.Range("B8").Value = UCase(Feuil8.Range("B8").Value)
leDoc.Content.Find.Execute FindText:="<BALISE7>", ReplaceWith:=Feuil8.Range("B8").Value, Replace:=WdReplaceAll
leDoc.Content.Find.Execute FindText:="<BALISE8>", ReplaceWith:=Feuil8.Range("B4").Value, Replace:=WdReplaceAll
Feuil8.Range("B9").Value = UCase(Feuil8.Range("B9").Value)
leDoc.Content.Find.Execute FindText:="<BALISE10>", ReplaceWith:=Feuil8.Range("B9").Value, Replace:=WdReplaceAll
Feuil8.Range("B12").Value = UCase(Feuil8.Range("B12").Value)
leDoc.Content.Find.Execute FindText:="<BALISE11>", ReplaceWith:=Feuil8.Range("B12").Value, Replace:=WdReplaceAll
leDoc.Content.Find.Execute FindText:="<BALISE12>", ReplaceWith:=Feuil8.Range("B12").Value, Replace:=WdReplaceAll
leDoc.Content.Find.Execute FindText:="<BALISE13>", ReplaceWith:=Feuil8.Range("B1").Value, Replace:=WdReplaceAll
If Feuil8.Range("B22").Value = "X" Then
leDoc.Content.Find.Execute FindText:="<1>", ReplaceWith:="X", Replace:=WdReplaceAll
Else
leDoc.Content.Find.Execute FindText:="<1>", ReplaceWith:="", Replace:=WdReplaceAll
End If
If Feuil8.Range("B23").Value = "X" Then
leDoc.Content.Find.Execute FindText:="<2>", ReplaceWith:="X", Replace:=WdReplaceAll
Else
leDoc.Content.Find.Execute FindText:="<2>", ReplaceWith:="", Replace:=WdReplaceAll
End If
If Feuil8.Range("B24").Value = "X" Then
leDoc.Content.Find.Execute FindText:="<3>", ReplaceWith:="X", Replace:=WdReplaceAll
Else
leDoc.Content.Find.Execute FindText:="<3>", ReplaceWith:="", Replace:=WdReplaceAll
End If
End Sub