I am using the FindReplace method to replace text in my document. When I use ReplaceAll everything works finde, but now I would like to only replace the first instance of a text, so I tried using FindNext and then Replace. My code looks like this:
Code: Select all
DOCX.Editor.FindReplace.BeginReplaceUI(Placeholder,NewText);
If DOCX.Editor.FindReplace.FindNext then
DOCX.Editor.FindReplace.Replace;
DOCX.Editor.FindReplace.EndFind;
How can I "reset" the search, so that it always starts from the beginning?
I tried the "Restart()" procedure, but didn't find a way to call for the first position of the document. I am unsure if this is the right approach anyway.
Any help would be much appreciated.