Word text to speach

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to get word to read my documents to me? I knwo excel can do it, but I don't need it for excel I need it in word
 
Hi,
Yeah, i'm trying to find this out my self, i'm sure it must be
possible, becasue like you say you can do it in excel, i was going to
use VBA to try and get it to work in word, but i found a little
programe that i use to read my word docs.

it's called "keymaster", becasue you can use it to tell you if the num
lock key is pressed and controll there activations and stuuf, but i
don't bother with this.
have not got a address for the site, but you get a full eval ed, which
you can then buy (or crack)
any way i'll keep looking for a "poper" way to get word to text-speek.
NOT speek-text, which is all it seam to want to do.

Regrads
Ross.
 
Just found this, which saved me having to code it.
I got it working on my PC, it ok, still like my keymaster app though.
cheeer ross.

PS, this use XP speach eng 5, win 2000 uses version 4, which has nicer
voices, but i think the same code should work in xp or 2k, not sure
about other os.
ross.

--------------------------------------------------------------
--------------------------------------------------------------
Re: getting Text to Speech to work in Word

The method described in the KB article mentioned above has you
starting up an Excel application to get speech. Here is a method to do
it just within Word:

The following applies to WordXP:
Go to the VBE (Alt+F11)
Add a reference in the normal project to Microsoft Speech Object
Library
(note: you must have installed the Speech portion of Excel for this
reference to be available.)
Create a new module
Insert the following code:
'Code Start =============================================
Dim speech As SpVoice

Sub SpeakText()
'
' Macro2 Macro
' Macro recorded 10/20/2003 by Mathew Heikkila
'
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(1,
ActiveDocument.Characters.Count).Text, _
SVSFlagsAsync + SVSFPurgeBeforeSpeak
End If

Do
DoEvents
Loop Until speech.WaitUntilDone(10)

Set speech = Nothing
End Sub

Sub StopSpeaking()
'used to interupt any running speach to text
'Dim speech As New SpVoice
On Error Resume Next
speech.Speak vbNullString, SVSFPurgeBeforeSpeak
Set speech = Nothing
End Sub

'Code End ====================================================

Now all you need are two toolbar buttons or menu items that run the
macros.
The SpeakText macro will speak the current selection, or the entire
document if nothing is selected.
The StopSpeaking macro will stop it.

Hope this can help anyone else who was as frustrated as me that Excel
had this feature but not Word.

Yes, its crude regarding the error trapping and using a global
variable. If anyone has a cleaner way, please post a reply. The whole
reason for this was to be able to stop the speaking. Simply creating a
new voice object and setting the PurgeBeforeSpeak flag did not work.
If the ASync flag is not turned on the in the speaktext macro, you
have to wait for it to finish before you can do anything else in Word.
 
Back
Top