The problem is the line
oFind.setString(FandR.ReplaceString)
The setString() method takes a string input and doesn't know anything about
the search done with oDoc.FindNext() or regular expressions. You can
perform a global replace that implements your regular expression with
oDoc.replaceAll(FandR)
Dear list members,
I need to write a macro that tries to match a series of regexs against some
text I've selected and then replace it with a replacement string that
contains captured groups.
I've tried the following (borrowed and modified from some on-line code) but
it doesn't recognise $0,$1,$2,