devxlogo

Adding Message to Forwarding E-mail

Adding Message to Forwarding E-mail

Question:
My company wishes to do some special e-mail forwarding. Is there a way to take an incoming message, place a message at the top or in the subject line, and then forward this as one message?

Answer:
If it’s o.k. for Outlook to be running at the time, you could create a VBA macro that does this pretty easily. Just create the code in the NewMail event to do something like this:

Set oNS = Outlook.Application.GetNamespace("MAPI")    Set oInbox = oNS.GetDefaultFolder(6)    Set oMsg = oInbox.Items.GetFirst()    Set oFwd = oMsg.Forward    oFwd.Body = "[Insert your text here]" & vbLf & vbLf & oMsg.Body    Set oFwdRecip = oFwd.Recipients.Add("[insert recipient addresses here]")    oFwd.Send

Note that this will only work while Outlook is running. If you’re good at VB Script you could do something similar and have it run server-side.

devx-admin

Share the Post: