View - Events - Autorun

Ribbon bar. Select the View tab. In the Display group, click Events and from the menu, select Autotun.

Classic menus. From the View - Events submenu, select Autorun.

You can save the document-level event code with a specific document so that it runs any time that document is opened. Note that the code must first be run or saved before this command is applicable.