Microsoft Office 2000/Visual Basic Programmer's Guide |
To automatically run code 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 PowerPoint while an add-in is loaded, the Auto_Open procedure will run when you reopen PowerPoint, since the add-in is reloaded on startup.