In a tip a couple of weeks ago, I told you how to use a VBA macro to display a dialog asking where to store the Sent message. Some people are wondering why it works until they close Outlook.
It's macro security. The easiest way to make it work is to go to Tools, Macro, Security and set it on Medium. We recommend Medium over Low so that unknown code isn't running without your knowledge, but you will need to Ok it each time you open Outlook.
The better option is to sign your macros with a digital signature then trust yourself and leave it set on High. This is the recommended method for all macros, but if you make any changes to a macro, you'll need to re-sign the project files.
To create a digital signature for signing VBA projects (in any Office
application):
- Search for selfcert (you may need to run setup again and install it) and run it.
- Follow the steps to create a digital certificate.
If it's not installed:
From Add/Remove programs, choose Office and Change. Select the option to add or remove features and advanced customization. Under Office Shared Featured, choose Digital Certificate for VBA Projects and install it.
Open Outlook and the VBA Editor (Alt+F11), then:
- Go to the editors's Tools, Digital Signature menu and follow the dialog to sign the project files. Save then close the editor.
- Close Outlook, clicking Save, if asked.
- Reopen Outlook. You should be asked about trusting the signee – select the option to always trust and allow it to run.
It should now run every time you use Outlook and if you need to sign macros for other Office applications, the procedure is basically the same.
Published November 29, 2005. Last updated on June 17, 2011.