This can be done from the macro menu or from the VB editor, but ONLY the word 'repl' in the text is replaced. Then I reopen the document and run the macro again. Only the word/phrase in the comments is replaced, not anywhere else in the document. All three occurences of the word 'repl' are indeed replaced by the text 'Replaced'. a company name), then go ahead and click Replace All.
Do the find/replace as you normally would-if you think you might accidentally replace something you shouldn’t, then do Find Next followed by Replace as necessary if you’re confident that you’ll only replace what you need to (e.g.The word/phrase you typed in the Find tab is carried over to the Replace tab, AND the ‘find in headers and footers’ setting is carried over too, even though there’s nothing to tell you that. Type the word/phrase you want to find in the Find field.This is important as this is the only place you can specify to search only in the comments. It will open with Replace as the active tab. Press Ctrl+h to open the Find and Replace window.
NOTE: It only works if you have some text in any header or footer in the document-if the headers/footers haven’t been used, then you do not get the option to find the text within them. Keep clicking it to browse through all the results. If you only want to find text in your document, you can go ahead and click the Find Next button to have Word jump to the next occurrence of that word. In the Find What box, type the word or phrase you want to locate. This post is similar to the one I wrote for finding/replace a word/phrase within comments. This opens Word’s Find and Replace window.