The following code is a vb script that converts text from user input into speech. I want text to be obtained from a txt file.
Dim msg, sapi
msg=InputBox("Hello", "hello")
Set sapi =CreateObject("sapi.spvoice")
sapi.Speak msg
The following code is a vb script that converts text from user input into speech. I want text to be obtained from a txt file.
Dim msg, sapi
msg=InputBox("Hello", "hello")
Set sapi =CreateObject("sapi.spvoice")
sapi.Speak msg
Const ForReading = 1
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Dim f
Set f = fso.OpenTextFile("c:\MyTextFile.txt", ForReading)
Dim text
text = f.ReadAll
f.Close