1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Dim aLstCaracteresAProbleme(0 To 3, 0 To 1) As String
aLstCaracteresAProbleme(0, 0) = "^~": aLstCaracteresAProbleme(0, 1) = "-"
aLstCaracteresAProbleme(1, 0) = "": aLstCaracteresAProbleme(1, 1) = "oe"
aLstCaracteresAProbleme(2, 0) = "'": aLstCaracteresAProbleme(2, 1) = "'"
aLstCaracteresAProbleme(3, 0) = Chr(1): aLstCaracteresAProbleme(3, 1) = ""
'// Remplacement des caractères à problème
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
For aI = LBound(aLstCaracteresAProbleme, 1) To UBound(aLstCaracteresAProbleme, 1)
With Selection.Find
.Text = aLstCaracteresAProbleme(aI, 0)
.Replacement.Text = aLstCaracteresAProbleme(aI, 1)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next |
Partager