Class Speech (Excel VBA)
Contains methods and properties that pertain to speech.
To use a Speech class variable it first needs to be instantiated, for example
Dim spc as Speech Set spc = Application.Speech
Speech class variables can be set using the Application.Speech procedure.
Returns or sets the order in which the cells will be spoken. The value of the Direction property is an XlSpeakDirection constant.xlSpeakByColumns - Reads down a column, then moves to the next column, xlSpeakByRows - Reads across a row, then moves to the next row.
Application.Speech.Direction = xlSpeakByColumns
Microsoft Excel plays back the text string that is passed as an argument.
Dim strText As String: strText = "Hello" Application.Speech.Speak Text:=strText
The following arguments are optional
SpeakAsync - 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
Purge - 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
Microsoft Excel supports a mode where the active cell is spoken when the Enter key is pressed or when the active cell is finished being edited. Setting the SpeakCellOnEnter property to True turns this mode on. False turns this mode off.
Application.Speech.SpeakCellOnEnter = True