C
Carl
Hello,
I make a fusion of personal fields into Word, with a vb project.
This code make my search and replace :
Public Sub Remplacer_texte(Texte_à_remplacer As Variant,
Texte_de_remplacement As Variant)
With myWordApplication //
instancié à l'init de la classe
.Selection.Find.ClearFormatting
.Selection.Find.Replacement.ClearFormatting
With .Selection.Find
.Text = Texte_à_remplacer
.Replacement.Text = Texte_de_remplacement
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Selection.Find.Execute Replace:=wdReplaceAll
End With
End Sub
It's works great !
But if there is a text area, the text into it is not replaced.
The strange thing, is when i do that directly with Word, Word replace the
texte into text areas too.
I maked a macro to see how Word do that, and the code is exactly the same
with my !!!
If somebody can help me ?
tks
Carl
I make a fusion of personal fields into Word, with a vb project.
This code make my search and replace :
Public Sub Remplacer_texte(Texte_à_remplacer As Variant,
Texte_de_remplacement As Variant)
With myWordApplication //
instancié à l'init de la classe
.Selection.Find.ClearFormatting
.Selection.Find.Replacement.ClearFormatting
With .Selection.Find
.Text = Texte_à_remplacer
.Replacement.Text = Texte_de_remplacement
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Selection.Find.Execute Replace:=wdReplaceAll
End With
End Sub
It's works great !
But if there is a text area, the text into it is not replaced.
The strange thing, is when i do that directly with Word, Word replace the
texte into text areas too.
I maked a macro to see how Word do that, and the code is exactly the same
with my !!!
If somebody can help me ?
tks
Carl