Hello,
I need a macro that can search for a webpage, then perform a search within that webpage and then pdf the results webpage and save it to a specific location.

I found the following code which will pull up a webpage in IE and then save it as a text file.
I just need to change it so that I can enter in a word or number to search for and then it will save the results page in pdf form.

I have adobe PDF and Cute PDF Writter on my computer. Either one will works fine.

Thanks,


'Summary: Copies the text of a web page to a text file.

Sub GetWebPageText()

  Dim FileName As String
  Dim FSO As Object
  Dim ieApp As Object
  Dim Txt As String
  Dim TxtFile As Object
  Dim URL As String
  
    URL = "www.google.com"
    FileName = "C:\Web Text.txt"
    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set TxtFile = FSO.OpenTextFile(FileName, 2, True, -1)
    
    Set ieApp = CreateObject("InternetExplorer.Application")
    ieApp.Visible = True
    ieApp.Navigate URL
    
      While ieApp.Busy Or ieApp.ReadyState <> 4
        DoEvents
      Wend

      Txt = ieApp.Document.body.innerText
        TxtFile.Write Txt
        TxtFile.Close
      
    ieApp.Quit
    
    Set ieApp = Nothing
    Set FSO = Nothing
    
End Sub