then i advised her to use one of ms office feature about speech recognition, which i knew in ms office 2003, but she had been using office 2007 for her purposes.
i tried to find in ms office 2007 feature, is this text-to-speech (TTS) exist or not, like as in office 2003... And i didn't find that.
Does ms office remove all TTS feature from office 2007 or there is something to do to enable it?
After googling to find this case, apparently, it needs some trick to make TTS active :
- when ms word 2007 is active, press alt+F11 (hold the Alt key down then press the F11 key) to open VBA Code editor
- in VBA Code Editor, select on 'Normal', see on picture.
- then insert new module by left click > insert > module, as shown on picture.
- add this code into new module:
- Option ExplicitDim speech As SpVoiceDim i As IntegerSub SpeakText()On Error Resume NextIf i = 0 ThenSet speech = New SpVoiceIf Len(Selection.Text) > 1 Then 'speak selectionspeech.Speak Selection.Text, SVSFlagsAsync + SVSFPurgeBeforeSpeakElse 'speak whole documentspeech.Speak ActiveDocument.Range(0, ActiveDocument.Characters.Count).Text, SVSFlagsAsync + SVSFPurgeBeforeSpeakEnd IfElseIf i = 1 Thenspeech.Resumei = 0End IfEnd IfEnd SubSub Stopspeaking()On Error Resume Nextspeech.Speak vbNullStringSet speech = Nothingi = 0End SubSub Pausespeaking()On Error Resume NextIf i = 0 Thenspeech.Pausei = 1ElseIf i = 1 Thenspeech.ResumeEnd IfEnd IfEnd Sub
- enable speech library by Select the Tools > References... menu option. Scan the list of references and click the little box next the Speech library, then click OK, see on pict
- save this module then return to ms word (File > Close and return to microsoft word).
- In order to conveniently run your macros, you will probably want to add three buttons to the quick access tool bar. You can do this by clicking the small downward arrow with the "Customize quick access toolbar" tooltip on the title bar of MS Word near the Save, Undo and Redo buttons. Select "More commands" in the dropdown menu to open the "Word options" window. Select "Customize" on left hand menu and "Choose commands from" should be set to "Macros". Add all three macros and this will create three buttons on the quick access tool bar. You can modify the button icons to more closely represent the TTS functions.
- Now your MS word is TTS enabled. Just click the Start, Pause, or Stop button
No comments:
Post a Comment