Picture of Make your windows read files writen in notepad!
Hi, I this instructable I will teach you how to make your windows xp read text files on your PC via a simple VBscript!. I made this instructable in response to some demand from a previous instructable that I made which is make your windows xp talk!
Anyways, this method uses the windows SAPI in order to read textfiles that are opened via a VBscript which opens the text file chosen, reads its contents and assigns a variable for them as this variable is then read(the contents are read) by the windows SAPI that will be called to read the variable
Follow up with this instructable to see a step by tutorial to make this cool and simple text reader!
Remark: after checking out this instructable please leave a comment about what you think about it and provide a rating, I will be more than happy to hear your comments! Thanks very much hope you like it and find it useful

Remove these adsRemove these ads by Signing Up

Step 1: Write up the script...

Picture of Write up the script...
First of all you should write up the program(VBscript that is responsible for all that reading). Open notepad and enter the following code in it!:

'Script written by Ayman Farhat (SCRIPTmaster)
'This script allows your PC to read contents of any text file you choose!
Const ForReading = 1
strText = InputBox("Please type in the name of the file you want to read the file, the file has an extension .txt","Read text files from notepad")
Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objText = objFSO.OpenTextFile(strText + ".txt", ForReading)

strText = objText.ReadAll


Set Sapi = Wscript.CreateObject("SAPI.SpVoice")

Sapi.speak strText

When you put the script save your work, when you save write the name of your script followed by.vbs extention as shown in the figure below

Step 2: Make the file you want to read...

Picture of make the file you want to read...
After you have saved your script it is supposed to execute when you launch and prompts you to enter the name of the file that you want to read.
Therefore you should make a text file that has the information you want to read when you are typing it up in notepad. Open notepad write whatever you want there and save it with the default extension which is usually .txt as shown below.
dD29 months ago
Is there anyway to make a fortune cookie version of this? Because that would be pretty freaking AWESOME! Lol!
Very creative. I've done some stuff like this before. Instead I used a batch file to send something to say to a VBscript and it would say whatever the person wrote. Very nice, nonetheless.
any way to change the voice? great instructable btw.
SCRIPTmaster (author)  blakdragon196 years ago
hx, actually you can change the voice by downloading different SAPI voices other than the default one provided by windows whhich is sam, you can find these voices at the Microsoft website just search for them (download SAPI voices,)..., after you download the voice you can set it as your default voice for your SAPI.., tutorial and documentation are usually available with the download so its not a problem installing it.... good luck
But you cannot add new voices to Windows Vista or 7
thanks man
SCRIPTmaster (author)  blakdragon196 years ago
no problem! good luck!
Super_Nerd4 years ago
Hey, this is so cool SCRIPTmaster! Just one question, is there a way to make the program read from a certain word in the file to the end of the line? I'm trying to make a program that stores info in a database and reads the info it has as a user input and gives it's respective output.
J-Manoo75 years ago
I noticed this only works if the txt file is in the same directory as the vbs file, regardless of whether it is open or not.  Is there a way to fix this?
mc_dude5 years ago
how in the f did you think of that? its so simple yet i would have never thought of it! cool
J-Manoo75 years ago
how did you learn how to use VBS?
how do u read a file that int on the desktop?
sunda666 years ago
Hi, fantastic !!!, it worked.
lolcat3606 years ago
im confused
yay! i can scrpit=] but is there a way to change the little rolled page icon that comes with the document?
I3uckwheat6 years ago
can u make one that u click on the vbs and then click the txt doc and make it read it pls?
Sandisk1duo6 years ago
Yay! Now someone can easily make ransom messages!