Running Code Automatically when a PowerPoint Add-in Is Loaded or Unloaded

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

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