' reading a file line by line
Const ForReading = 1
' create file system object
Set objFS = CreateObject("Scripting.FileSystemObject")
' first check that the file exists
If objFS.FileExists("c:\TextFile.txt") Then
' open the text file for reading
Set objFile = objFS.OpenTextFile("c:\TextFile.txt", ForReading, False)
' do until at end of file
Do Until objFile.AtEndOfStream
' store the value of the current line in the file
strLine = objFile.ReadLine
' show the line from the file
MsgBox strLine
Loop ' next line
' close the file
objFile.Close
Set objFile = Nothing
Else ' file doesn't exist
' report a failure
Reporter.ReportEvent micFail, "Read File", "File not found"
End if ' file exists
' destroy the objects
Set objFS = Nothing
Const ForReading = 1
' create file system object
Set objFS = CreateObject("Scripting.FileSystemObject")
' first check that the file exists
If objFS.FileExists("c:\TextFile.txt") Then
' open the text file for reading
Set objFile = objFS.OpenTextFile("c:\TextFile.txt", ForReading, False)
' do until at end of file
Do Until objFile.AtEndOfStream
' store the value of the current line in the file
strLine = objFile.ReadLine
' show the line from the file
MsgBox strLine
Loop ' next line
' close the file
objFile.Close
Set objFile = Nothing
Else ' file doesn't exist
' report a failure
Reporter.ReportEvent micFail, "Read File", "File not found"
End if ' file exists
' destroy the objects
Set objFS = Nothing
Do you have a spam issue on this blog; I also am a blogger,
ReplyDeleteand I was wondering your situation; many of
us have created some nice procedures and we are looking to exchange strategies with other folks, please shoot
me an e-mail if interested.
my website; planet minecraft
Does your site have a contact page? I'm having a tough time
ReplyDeletelocating it but, I'd like to shoot you an e-mail. I've got
some suggestions for your blog you might
be interested in hearing. Either way, great blog and I
look forward to seeing it improve over time. Quest Bars blogesaurus
my page :: quest protein bars
Just wish to say your article is as astounding.
ReplyDeleteThe clarity to your put up is simply great and that i could think you are
a professional on this subject. Fine together with your permission let me
to seize your feed to stay updated with forthcoming post.
Thank you a million and please carry on the enjoyable work.
Feel free to surf to my homepage; facebook quest protein bar
What's up it's me, I am also visiting this web page on a regular basis,
ReplyDeletethis website is truly fastidious and the visitors are in fact sharing nice thoughts.
Here is my blog post; Diet Plans for Women
hello!,I like your writing very much! share we communicate extra approximately
ReplyDeleteyour post on AOL? I require an expert in this area to resolve my problem.
Maybe that's you! Taking a look ahead to look you.
Check out my web page ... Lose Weight for Women
hi!,I like your writing very a lot! share we keep in touch more approximately your post
ReplyDeleteon AOL? I need an expert in this area to resolve my problem.
May be that's you! Looking forward to peer you.
Here is my webpage; Diet Plans for Women to Lose Weight
Pretty element of content. I just stumbled upon your weblog and in accession capital to assert that I get in fact loved account your
ReplyDeleteweblog posts. Anyway I'll be subscribing in your feeds and even I achievement you get admission to
persistently fast.
my page Diet Plans for Women to Lose Weight