Private Sub Document_Open()
Dim repertoire$, tva1#, tva2#, tva3#, tva4#, txt$
Dim t1$, t2$, t3$, t4$, i%, c As Object
repertoire = "Salles" 'à adapter
tva1 = 0.07: tva2 = 0.1 'taux de TVA, à adapter
tva3 = 0.196: tva4 = 0.2
txt = "TVA " & 100 * tva2 & " % - " & 100 * tva4 & " %" 'repérage
With ActiveDocument.Sections(1).Footers(1).Range 'pied de page
' If ActiveDocument.Path Like "*\" & repertoire _
' And Not .Text Like txt & "*" Then
t1 = "*" & Replace(1 + tva1, ",", ".")
t2 = "*" & Replace(1 + tva2, ",", ".")
t3 = "*" & Replace(1 + tva3, ",", ".")
t4 = "*" & Replace(1 + tva4, ",", ".")
For i = 1 To ActiveDocument.InlineShapes.Count
ActiveDocument.InlineShapes(i).OLEFormat.Activate
With GetObject(, "Excel.Application")
If .workbooks.Count > i Then MsgBox "Fermez tout fichier Excel !": End
For Each c In .workbooks(i).sheets(1).[A1:U231]
If InStr(c.Formula, t1) Then c = Replace(c.Formula, t1, t2)
If InStr(c.Formula, t3) Then c = Replace(c.Formula, t3, t4)
Next
End With
.Text = txt 'repérage en pied de page
Next
' End If
End With
End Sub