Archive for June, 2011

Outlook: always use reply-to (return mail) for free

At work I have to use Windows 7 with Outlook 2003. We needed a solution to add the reply-to header to all outgoing mails. As out server uses Exchange 2003, Transport agents to change smtp headers are not supported.

So I had to code a client (Outlook 2003) solution, because the add-ins cost about 50 $ per user.

Add Reply-to header to all outgoing mails

  1. In Outlook open your Visual Basic Editor (<Alt>+<F11> or Extras → Macro → Visual Basic Editor)
  2. I did this in german, so the names may vary a bit: In Project1 (VbaProject.OTM) open Microsoft Office Outlook Objects → ThisOutlookSession
  3. Enter the following Code
    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    
        'add reply-To address
        Item.ReplyRecipients.Add "office@example.com"
        Item.ReplyRecipients.ResolveAll
    
    End Sub
  4. Save it

Activate the macro

Because macros are “dangerous” you have to set the security level down.

  1. Open Extras → Macro → Security.
  2. Change the security level from high to medium (or low which is not recommended)
  3. Click OK.

Further suggestions

  • You can sign you macro and always trust macros from yourself, so that you do not have to activate macros every time you start outlook (when you are on the medium security level)
  • For deployment I recommend you to sign the macro and then copy the the file %appdata%\Microsoft\Outlook\VbaProject.OTM to the new computer (this overwrites all macros on the new computer with the macros from the source computer). On the new computer you should install the signature (In the security warning on Outlook startup click Details → Show Certificate → Install Certificate and then restart Outlook and always trust the macros from that source.

Sources: Change reply recipient dependent on the mail domain (german)

Advertisements