Results 1 to 4 of 4

Thread: [RESOLVED] Save as txt in c:\mydir, html page

  1. #1

    Thread Starter
    Join Date
    Mar 2005

    Resolved [RESOLVED] Save as txt in c:\mydir, html page

    Based this url:

    how to save as txt entire html page?

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013

    Re: Save as txt in c:\mydir, html page

    How do you access the page currently from within your application?

  3. #3
    Hyperactive Member
    Join Date
    Jul 2022

    Re: Save as txt in c:\mydir, html page

    You can use this to save a page HMTL to a text file.
    I tried to use it with your link, but it timed out (edit: unable to use a browser either, maybe region locked?). Thus, I have the other one there for testing.

        Dim HTTPRequest As MSXML2.XMLHTTP   ' *** need Reference to Microsoft XML, v3.0
        Dim url As String
        Dim fs As FileSystemObject                     ' *** need reference to Microsoft Scripting Runtime
        Dim pageAsTextStream As TextStream
        Dim pageAsTextFilename As String
        ' Open the HTTP request and send it
        'url = ""
        url = ""
        ' create the HTTP object and contact the website
        Set HTTPRequest = New MSXML2.XMLHTTP
        HTTPRequest.Open "GET", url, False
        ' create the file name to save to
        pageAsTextFilename = "C:\Temp\" & Format(Now, "MM-dd-yyyy HHmmss") & "_comuni.txt"
        ' using the file system object, create a textfile with the html
        Set fs = New FileSystemObject
        Set pageAsTextStream = fs.CreateTextFile(pageAsTextFilename)
        pageAsTextStream.Write HTTPRequest.responseText
        ' release the objects used
        Set pageAsTextStream = Nothing
        Set fs = Nothing
        Set HTTPRequest = Nothing

  4. #4
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Wales UK

    Re: Save as txt in c:\mydir, html page

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