I need a Macro for Microsoft Word to search and replace strings in the document.
Full regex power should be available; meaning that Microsoft VBScript Regular Expressions 5.5 will be used. (The reference is already activated on my system.)
The macro should be able to execute whatever search-and-replace operations I define. I imagine it like this:
On starting the macro, a dialogue will appear with two fields where I can enter my search string and my replace string.
On klicking the "Go" button in the dialogue, the macro will search and replace text in the document which is currently open.
If text has been highlighted in the document, the replacement should be executed only on the highlighted section.
If nothing has been highlighted, the replacement should be executed in the entire document.
As an additional feature, the dialogue should keep the latest 30 (or more) search-and-replace combination in a dropdown field or so, so that I can re-use them later without much thinking about the syntax.
The macro code can be delivered as a simple txt-file. I can take the code and put it into one of my modules.
Alternatively, you can send a [url removed, login to view] with the macro included.