Speak Method

Microsoft Excel Visual Basic

Show All

Speak Method

       

Speak method as it applies to the Range object.

Causes the cells of the range to be spoken in row order or column order.

expression.Speak(SpeakDirection, SpeakFormulas)

expression   Required. An expression that returns a Range object.

SpeakDirection  Optional Variant. The speak direction, by rows or columns.

SpeakFormulas  Optional Variant. True will cause formulas to be sent to the Text-To-Speech (TTS) engine for cells that have formulas.  The value is sent if the cells do not have formulas.  False (default) will cause values to always be sent to the TTS engine.

Speak method as it applies to the Speech object.

Microsoft Excel plays back the text string that is passed as an argument.

expression.Speak(Text, SpeakAsync, SpeakXML, Purge)

expression   Required. An expression that returns a Speech object.

Text  Required String. The text to be spoken.

SpeakAsync  Optional Variant. True will cause the Text to be spoken asynchronously (the method will not wait of the Text to be spoken).  False will cause the Text to be spoken synchronously (the method waits for the Text to be spoken before continuing).  The default is False.

SpeakXML  Optional Boolean. True will cause the Text to be interpreted as XML. False will cause the Text to not be interpreted as XML, so any XML tags will be read and not interpreted. The default is False.

Purge  Optional Variant. True will cause current speech to be terminated and any buffered text to be purged before Text is spoken. False will not cause the current speech to be terminated and will not purge the buffered text before Text is spoken. The default is False.

Example

In this example, Microsoft Excel speaks "Hello".

Sub UseSpeech()

    Application.Speech.Speak "Hello"

End Sub