Speech.Speak method (Excel)
Microsoft Excel plays back the text string that is passed as an argument.
Syntax
expression.Speak (Text, SpeakAsync, SpeakXML, Purge)
expression A variable that represents a Speech object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Text | Required | String | The text to be spoken. |
SpeakAsync | Optional | Variant | True causes the text to be spoken asynchronously (the method will not wait for the text to be spoken). False causes the text to be spoken synchronously (the method waits for the text to be spoken before continuing). The default is False. |
SpeakXML | Optional | Variant | True causes the text to be interpreted as XML. False causes the text to not be interpreted as XML, so any XML tags are read and not interpreted. The default is False. |
Purge | Optional | Variant | True causes current speech to be terminated and any buffered text to be purged before text is spoken. False does not cause the current speech to be terminated and does 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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.