Introduction to Macros for MS Outlook

Wednesday, November 3, 2010 by Tan

I am here again today with another introductory post. Hope you are enjoying the series and using the information shared here. Today, I will introduce Macro for Microsoft Office Outlook. This is interesting, as we would all like someone to check our daily emails, put those emails into different folders, sort them on our requirements and probably compose and email a reply to the sender with the adequate information. Yes, all these are possible in Outlook itself and whatever is not already present, can be achieved using a bit of VBA coding or using Macros. Macros in Outlook are fascinating and today I will show you a simple macro which will tell you when an email lands up in your mailbox.

Open Outlook and Hit Alt + F11 to open the VBA Editor. This is what you do to open the editor in any Microsoft Office Application. Once in the editor, add a new module and type in this text below:

Sub MsgAlert(NewMail As Outlook.MailItem)
MsgBox "You have got a Mail."
& vbCr & "Subject: " & NewMail.Subject & vbCr & "From: "
& NewMail.SenderName & vbCr & vbCr & "It Says:- " & vbCr
& NewMail.Body, vbInformation, "Attention!"
End Sub

This will tell you with a message box telling about the new email that has landed in your inbox with fields like, Subject, Sender Name and the Content of the email. Now, you may add a rule to call this Macro or just modify an existing rule to incorporate this script. To know about Rules and Alerts in Outlook, visit this link.

Macros in Outlook can also be used to automate any task that you perform over and over again. Like sending an End of Day Report Notification or may be responding to specific email lists etc.

To know more about Codes in outlook, you may also visit this exciting website:

Do let me know how it went. Till then, cya!
Posted in Labels: , , , | 0 Comments »

0 Reviews: