Skip navigation

Outlook: Creating a Custom Pop-Up Box


How can I make a box pop up when I send a message so that I can set a category for the message I'm sending?

This task is easy to do with Visual Basic for Applications (VBA) code in Outlook 2002, which adds a ShowCategoriesDialog method to all Outlook items. Just put the code that Listing 1 shows in the ThisOutlookSession module in your VBA project. If you need help getting started with Outlook VBA, I've summarized the basics in my August 2001 Windows & .NET Magazine Outlook VBA on Demand column "Back to Basics" (, InstantDoc ID 21522).

In Outlook 2000, the addition isn't quite so simple because messages that you create with WordMail (i.e., Microsoft Word as your email editor) act differently from those you create with the built-in Outlook editor. However, if you're using the built-in editor, use the code that Listing 2 shows, again putting it in the ThisOutlookSession module. After checking to make sure you're not using Word as the editor, you can use this procedure to locate the toolbar or menu command for the Options dialog box by its ID number, then execute it. The user sees the full Options dialog box, just as if they'd clicked the Options button on a message.

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.