Mar 9th, 2005, 01:37 PM
#1
Thread Starter
Lively Member
Search VB Files for text.
I am trying to make an application that will search all .bas, .frm. .cls files in a folder for the words "Fatal" and "msgBox". I want it to find these words and copy the line that these words are on, the line before and copy them into a word or text file. It would also be nice to have it so that the filename ex: frmMain.frm could be used as a heading before the fatal and msgbox lines.
Ex:
frmMain.frm
fatal"Error"
msgBox "bla blah blah"
Fatal "error 2"
frmBlah.frm
fatal "error"
Anyone got any ideas or help woth some of the code to be able to make this?
thnaks in advance.
Mar 9th, 2005, 01:52 PM
#2
Re: Search VB Files for text.
I made a toy example to do this. Try it out it will probably get you started.
Attached Files
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Mar 9th, 2005, 02:03 PM
#3
Thread Starter
Lively Member
Re: Search VB Files for text.
Thanks, thats a good help.
Mar 9th, 2005, 02:21 PM
#4
Thread Starter
Lively Member
Re: Search VB Files for text.
anyone have any ideas how i could search a textfile for the words Fatal and msgbox, Then copy the entire line?
Mar 9th, 2005, 02:28 PM
#5
Re: Search VB Files for text.
That project I uploaded is easily adaptable to do whatever you need.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width