macrotraining: At the top of the Office forum where you posted your thread is -
*** Do not post WORD questions here! ***
Please post Word questions in the appropriate Word forum, in this case the Word VBA forum (
https://www.msofficeforums.com/word-vba/).
Also, when posting code, please use the code tags, inserted via the # button on the posting menu.
Now moving thread to the correct forum...