Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / Office

Automatically Readloud Sender and Email Subject in OUTLOOK

5.00/5 (3 votes)
17 Jan 2015CPOL 11.3K  
Read Loud Email Sender and Subject as soon as you received an email in OUTLOOK

Introduction

Have you ever wondered, whether outlooks has a feature to read loud new emails ? It is challenging becuase Text to Speach intergation in outlook is not  that flexibile, however it can be achived by utilizing Microsoft Excel applicaiton object.

Yes it is possible by creating a simple macro to invoke excel text to speach integraion & assosiating it with a Rule as follows.

Using the code

Open Outllook email client and press "Alt +F11" which loads VBA editor. Please create a read loud method as follows.

VB.NET
Public Sub AnnounceMail(Item As Outlook.MailItem)

    Dim xlApp As Object
 
    Dim strFrom As String
    Dim strMessageType As String
    Dim ReadOutText As String
    
    Set xlApp = CreateObject("Excel.Application")
    
    strFrom = Split(Item.Sender, " ")(0)
    strMessageType = Right(Item.Subject, 3)
            
     ReadOutText = "Master,"
     
Select Case strMessageType
    Case "RE:"
        ReadOutText = ReadOutText & strFrom & " replied to an email regarding, " & Item.ConversationTopic
    Case "FW:"
       ReadOutText = ReadOutText & strFrom & " Forwarded an email regarding, " & Item.ConversationTopic
    Case Else
      ReadOutText = ReadOutText & "You have an email from " & strFrom & " regarding, " & Item.ConversationTopic
End Select
    
     ReadOutText = ReadOutText & "."
     
    xlApp.Speech.Speak ReadOutText
    xlApp.Quit
    
    Set xlApp = Nothing

End Sub

Points of Interest

VB.NET
Set xlApp = CreateObject("Excel.Application")

The Annouse mail mehod will utlise Excel to access Text to Speach Engine.

VB.NET
xlApp.Speech.Speak ReadOutText

This code will invoke windows speach engine!

Step 2 :

The next step will be to create a Outlook email rule as below and assosaite with AccountMail method.

Rule should run for Message arrives on this computer.

 

 

Done! Outlook will start read lould all your new mails.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)