Word Makro to replace text inside a (german word) "Textfeld"?

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top