Running Code Automatically when a PowerPoint Add-in Is Loaded or Unloaded
To run code automatically when an add-in is loaded, create a Sub procedure named Auto_Open in a standard module in the Add-In project. Any code within this procedure runs when the add-in is loaded. To run code when an add-in is unloaded, add a procedure named Auto_Close.
If you close Microsoft® PowerPoint® while an add-in is loaded, the Auto_Open procedure will run when you reopen PowerPoint, because the add-in is reloaded on startup.
See Also
PowerPoint Add-ins | Creating a PowerPoint Add-in | Loading a PowerPoint Add-in