To work with macros in Microsoft Office, the ribbon for development tools must be enabled. Enable Developer Ribbon in File → Word Options → Customize Ribbon.
See Microsoft Developer Network note 608625 ({+}https://msdnlearn.microsoft.com/en-us/visualstudio/library/bb608625.aspx)+.
...
vsto/how-to-show-the-developer-tab-on-the-ribbon?view=vs-2022.