VB Code:
  1. Dim SearchString as STring
  2. dim filec as string
  3.  
  4. SearchString = "Visual Basic"
  5.  
  6.  
  7. open "C:\text1.txt" for input as #1
  8. filec = input(lof(1),1)
  9. close #1
  10.  
  11. if instr(filec,searchstring) then
  12. open "C:\text2.txt" for input as #1
  13. filec=input(lof(1),1)
  14. close #2
  15.  
  16. 'then do whatever after you opened the second file
  17.  
  18. end if