Outlook Tips--Prompting the User for a Folder


Lotus Notes can prompt the user for the folder in which it should file an outgoing message. Does Outlook have a similar function?

In Outlook, you can set the storage folder on the Options dialog box for a message before you send it. However, with a little Outlook Visual Basic for Applications (VBA) code, you can easily prompt the user for the storage folder when the user sends the message. Here are two options.

Open the VBA environment by pressing Alt+F11. If you want to be prompted for a folder every time you send a message, type the code from Listing 1 into the built-in ThisOutlookSession module. Web Listing 1 (available at http://www.exchangeadmin.com) is a variation on this Listing 1 that my fellow Exchange Administrator editor Tony Redmond suggested. If the user doesn't choose a folder from the Pick Folder dialog box, the code sets the SaveSentMessage folder to the Deleted Items folder.

Sometimes you don't want to be prompted every time you send an item. If you want most of your messages to go to the default Sent Items folder but you want to retain the option to select a different folder, type the code from Listing 2 into the ThisOutlookSession module or into a separate module that you add with the Insert, Module command in the VBA editor. This version prompts you for a folder, then sends the item. You can add it to a toolbar button for the new Message window. (My November 1999 column explains how to add a toolbar button.)

Be aware that if you've installed the Outlook E-mail Security Update, this method will display a prompt that you must respond to. If you want to avoid the prompt, you can delete the objItem.Send statement. The macro will then just set the storage folder; you need to click Send manually.

The Microsoft article "How to Prevent the VBA Macro Security Warning in Microsoft Outlook 2000" (http://msdn.microsoft.com/library/techart/oldigitalsignature.htm) explains how to avoid a macro warning prompt when you start Outlook with code in VBA. Follow the article's instructions for changing the macro security level and signing your code.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.