How to Turn on Text to Speech for Word 2007

Beginning with Microsoft Windows 2000, core Microsoft utilities have had the ability to read written text out loud. This capability, called "Text To Speech," is not included in Word 2007. If you have installed Microsoft Speech Object Library on the computer, however, you can re-enable the speech capability using a special macro code.

...
Adding Text To Speech to Word 2007 allows the computer to read documents out loud.

Add Speech Reference

Step

Start the Microsoft Visual Basic Editor from within Word by pressing Alt+F11 keys. Click the "Tools" menu and then select "References." On the list marked "Available References," scroll until "Microsoft Speech Object Library" is selected. Click the check box next to this listing. Click "OK."

Step

Add a new module by clicking "Create a New Module" on the Microsoft Visual Basic Editor. Select the "Name" field and enter "TextToSpeech." In the "Macro" command area, paste the following code:

Step

Dim speech as SpVoice Sub SpeakText() On Error Resume Next Set speech = New SpVoice If Len(Selection.Text) > 1 Then 'speak selection speech.Speak Selection.Text, SVSFlagsAsync + SVSFPurgeBeforeSpeak Else 'speak whole document speech.Speak ActiveDocument.Range(0, ActiveDocument.Characters.Count).Text, SVSFlagsAsync + SVSFPurgeBeforeSpeak End If Do DoEvents Loop Until speech.WaitUntilDone(10) Set speech = Nothing End Sub

Step

Sub StopSpeaking() 'Based on a macro by Mathew Heikkila 'used to interrupt any running speech to text On Error Resume Next speech.Speak vbNullString, SVSFPurgeBeforeSpeak Set speech = Nothing End Sub

Step

Right-click on the Word 2007 toolbar. From the list, select "Customize Quick Access Toolbar." Click "Add Macro" and choose the newly created "TextToSpeech" macro. Click "Add" and then "OK." This toolbar button will now turn text to speech on and off as needed.