VBScript: Speak out the Contents of Text File.

Here is a VBScript Code using SAPI and FileSystem object, to Read Contents of a text file, and then Convert it into Audio

On Error Resume Next
Dim gh, gFile, gFso, gData
Set gFso = CreateObject("Scripting.FileSystemObject")
gFile = InputBox("Enter The
File Name to Read","Ebook Reader","Exmple.txt")
Set gh = gFso.OpenTextFile(File,1,True,0)
gData = gh.ReadAll
("SAPI.SPVoice").Speak gData

No comments:

Post a Comment

Thank you for commenting. Please keep visiting.