I’m looking for a simple way to delete repeated text in a Word 2007 document. If there are some shortcuts with the Find/Replace commands, I’m not seeing it. Otherwise, can someone recommend how I might write a macro that works like the following:
1- Select a block of text (could be mulitple paragraphs, have bullet points, etc).
2- Run the macro or do the command.
3- The macro or command deletes all instances of the selected text block.
Any insight here?
Selection.Text returns the current selection’s text.
In principle, the syntax for your Replace command is:
You replace by an empty string, thus delete every instance of the text to find.
But: You have to decide of course how to handle the formatting of the selected text, maybe have to analyze your selected block first because replacing might not work with control chars neglected by Selection.Text … This is just the start, you need to specify what you want and then ask again, yourself or us. Meanwhile Record macro and the word vba reference are your friends.