Results 1 to 5 of 5

Thread: Search VB Files for text.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    95

    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.

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    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 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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    95

    Re: Search VB Files for text.

    Thanks, thats a good help.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    95

    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?

  5. #5
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    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
  •  



Click Here to Expand Forum to Full Width