Removing Active Content from E-Mails Sent via Outlook Forms

May 16th, 2012 | Posted by Sebastian Wain in Microsoft Outlook

The Outlook forms alternative

Sometimes creating Outlook forms is a good alternative to developing Outlook add-ons. They can run scripts written in VBScript, an old fashioned language, but powerful enough. Another benefit of creating Outlook forms is that they do not need to be installed as extra software. Outlook forms can be deployed and shared on a Microsoft Exchange Server or as a file.

One problem that arises when you use Outlook forms as a template for e-mails is that if they contain scripting, the script is attached to the e-mail as a winmail.dat file. When the recipient opens the e-mail he will see the message “The item contain active content that cannot be displayed in the Reading Pane. Open the item to read its contents.”. This is annoying since users may suspect active content of being malicious and they can’t preview it.

This is a quick step by step example to create a new Outlook form to use as an e-mail template and remove the script in the send event. We set the UseTNEF MAPI property to false to achieve this result.

Creating the Outlook Form Template

  1. Enable the developer options
  2. Click “New/Choose Form”
  3. Select “Message” from the “Standard Forms Library”
  4. Write the content of your e-mail template
  5. Go to the developer option or ribbon under Outlook 2007/2010 and click on “Design This Form”
  6. Click on “View Code”
  7. Click on “Script/Event Handler…” option
  8. Select the “Send” event
  9. Add the following code to remove the script
Function Item_Send()

   MsgBox "Item being sent without a winmail.dat file attached"
   Item.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", False

End Function
  1. Close the script editor
  2. Click on “Publish/Publish Form As” and choose a name to be stored in the “Personal Forms Library”
  3. It is saved now

Using the Outlook Form Template

  1. Click “New/Choose From”
  2. Go to the “Personal Forms Library” and select your created form
  3. Complete the e-mail
  4. Press “Send”

Voilà! The e-mail is sent without active content.

Related Services

  1. Outlook Plugin Development
  2. Reverse Engineering

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.