You can save macros in documents and have them work with the ThisDocument object. In all but legacy versions of Word, they would be saved in files with a .docm extension. They can also be saved in legacy .doc format files.