3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Make your windows read files writen in notepad!

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 1Write up the script...

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

objText.Close

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
« Previous StepDownload PDFView All StepsNext Step »
15 comments
Aug 10, 2008. 12:20 AMblakdragon19 says:
any way to change the voice? great instructable btw.
Aug 9, 2011. 2:41 PMSuper_Nerd says:
But you cannot add new voices to Windows Vista or 7
Aug 11, 2008. 8:30 AMblakdragon19 says:
thanks man
Jan 31, 2011. 7:00 PMSuper_Nerd says:
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.
Feb 17, 2010. 7:16 PMJ-Manoo7 says:
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?
Feb 16, 2010. 5:44 PMmc_dude says:
how in the f did you think of that? its so simple yet i would have never thought of it! cool
Apr 21, 2009. 7:04 PMJ-Manoo7 says:
how did you learn how to use VBS?
Feb 22, 2009. 5:51 PMTheAmazingQuackinator says:
how do u read a file that int on the desktop?
Oct 5, 2008. 12:14 PMsunda66 says:
Hi, fantastic !!!, it worked.
Aug 17, 2008. 2:54 PMlolcat360 says:
im confused
Aug 14, 2008. 2:40 AMwolf555hound says:
yay! i can scrpit=] but is there a way to change the little rolled page icon that comes with the document?
Aug 5, 2008. 7:33 AMI3uckwheat says:
can u make one that u click on the vbs and then click the txt doc and make it read it pls?
Jul 30, 2008. 8:49 AMalex-sharetskiy says:
Yay! Now someone can easily make ransom messages!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
8
Followers
5
Author:SCRIPTmaster