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.