Sometimes people ask where to put the code they find on this site or elsewhere. Here's a brief explanation of how to do so.
First, open the VB IDE in Outlook by pressing Alt+F11. Then press Ctrl+R or go to View » Project Explorer. You should see something similar to this:
Expand the default project by clicking the plus sign ([+]) next to the project name. Note that Outlook only has and only allows one VB project. You should then see:
You will see "Microsoft Office Outlook Objects" by default. If you have any standard modules, you will also see a "Modules" group and if you have any class modules, a "Class Modules" group.
- To add event code to ThisOutlookSession, expand the "Microsoft Office Outlook Objects" group and double-click ThisOutlookSession.
- To add other code (functions, procedures), expand the "Modules" group and either add the code to an existing standard module or go to Insert » Module to add a new module.
- To add code to a class module, expand the "Class Modules" group and either add the code to an existing class module or go to Insert » Class Module to add a new module.
This is similar to Excel's VB IDE, which has built-in class modules (i.e. ThisWorkbook), standard modules and class modules.