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 will cause the Text to be spoken asynchronously (the method will not wait of the Text to be spoken). False will cause theText to be spoken synchronously (the method waits for the Text to be spoken before continuing). The default is False.
SpeakXML Optional Variant 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".

Visual Basic for Applications
Sub UseSpeech() Application.Speech.Speak "Hello" End Sub

See also: