D
Detlef Conradin
I've tried to replace text in a document by calling
selection.find.execute in a loop.
and replacing text by selection.text="some new text"
inside the loop.
Basically something like this:
While Selection.Find.Execute
Selection.Text="some new text"
Wend
Unfortunately this seems no to work. Only the first occurence gets
replaced. If I do not replace anything the selection cycles correctly
trough the document. The problem is probably that the
second time the execute method gets called it searches only
"some new text", which doesn't contain my pattern anymore...
So the loop ends....
But why does it continue if i do not change selection.text in the loop?
selection.find.execute in a loop.
and replacing text by selection.text="some new text"
inside the loop.
Basically something like this:
While Selection.Find.Execute
Selection.Text="some new text"
Wend
Unfortunately this seems no to work. Only the first occurence gets
replaced. If I do not replace anything the selection cycles correctly
trough the document. The problem is probably that the
second time the execute method gets called it searches only
"some new text", which doesn't contain my pattern anymore...
So the loop ends....
But why does it continue if i do not change selection.text in the loop?