Wednesday, September 28, 2016

Outlook Forward An Email Macro

Outlook macros are a nice way to streamline a repetitive task down to a single click or keystroke. The code below simply forwards the currently selected email to a predefined email address. And since I can't what I did two seconds ago, I add the email to the "Green Category", my reminder that I really did forward it.  

Sub ForwardWithoutPrompt()
Dim forwardaddress As String
Dim objMail As Outlook.MailItem
forwardaddress = "EMAIL ADDRESS GOES HERE"
Set objItem = GetCurrentItem()
Set objMail = objItem.Forward
objMail.To = forwardaddress
objMail.Send
objItem.Categories = "Green Category"
Set objItem = Nothing
Set objMail = Nothing
End Sub

No comments:

Post a Comment