T
Thomas Hermanns
Hallo all
I have recorded a makro to replace text in a word document like thi
Sub Makro
wrdApp.Selection.Find.ClearFormattin
wrdApp.Selection.Find.Replacement.ClearFormattin
With wrdApp.Selection.Fin
.Text = "<kun-name>
.Replacement.Text = "Hermanns
.Forward = Tru
.Wrap = wdFindContinu
.Format = Fals
.MatchCase = Fals
.MatchWholeWord = Fals
.MatchWildcards = Fals
.MatchSoundsLike = Fals
.MatchAllWordForms = Fals
End Wit
wrdApp.Selection.Find.Execute Replace:=wdReplaceAl
End Su
The makro works fine, when the text "<kun-name>" is somewhere in the document. If the text "<kun-name>" is inside a frame "Textfeld" (sorry I don't know the englisch translation for it), the the text is not replace. What is the problem
P.S.: A "Textfeld" is the rectangle frame, you can insert, to have the possibility of free positioning of text-blocks in the word document. There are two kinds of thus frames available, the old "Positionsrahmen" and the newer "Textfeld"
I have recorded a makro to replace text in a word document like thi
Sub Makro
wrdApp.Selection.Find.ClearFormattin
wrdApp.Selection.Find.Replacement.ClearFormattin
With wrdApp.Selection.Fin
.Text = "<kun-name>
.Replacement.Text = "Hermanns
.Forward = Tru
.Wrap = wdFindContinu
.Format = Fals
.MatchCase = Fals
.MatchWholeWord = Fals
.MatchWildcards = Fals
.MatchSoundsLike = Fals
.MatchAllWordForms = Fals
End Wit
wrdApp.Selection.Find.Execute Replace:=wdReplaceAl
End Su
The makro works fine, when the text "<kun-name>" is somewhere in the document. If the text "<kun-name>" is inside a frame "Textfeld" (sorry I don't know the englisch translation for it), the the text is not replace. What is the problem
P.S.: A "Textfeld" is the rectangle frame, you can insert, to have the possibility of free positioning of text-blocks in the word document. There are two kinds of thus frames available, the old "Positionsrahmen" and the newer "Textfeld"