The problem is that your code selects something. There is rarely any need for content to be selected via code, or otherwise unless you want to restrict processing to a selected range. See, for example, the second macro in:
https://www.msofficeforums.com/word-...tml#post127202. That said, without seeing your code and a document with a representative sample of the content you're trying to process, we're limited in the advice we can give.