How to Turn on Text to Speech for Word 2007

How to Turn on Text to Speech for Word 2007 thumbnail
Adding Text To Speech to Word 2007 allows the computer to read documents out loud.

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.

Things You'll Need

  • Microsoft Speech Object Library
Show More

Instructions

  1. Add Speech Reference

    • 1

      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."

    • 2

      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:

      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

      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

    • 3

      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.

Related Searches:

References

  • Photo Credit speaker image by Aditia Patria Warman from Fotolia.com

Comments

You May Also Like

Related Ads

Featured