Public Function SpeechText(ByVal cTextToRead As String) As Integer
On Error GoTo ErrorHandler
Dim oVoise As SpeechLib.SpVoice
Set oVoise = New SpeechLib.SpVoice
oVoise.Speak cTextToRead
SpeechText = 1
Exit Function
ErrorHandler:
MsgBox err.Description & " (" & CStr(err.Number) & ")"
SpeechText = 0
End Function
Sub tmp()
MsgBox IIf(SpeechText("This is a testing information") = 1, "Success!", "Failing")
End Sub
10楼有示例