Save to an XML File

Posted on 2006-05-23
Last Modified: 2010-05-01
I am using VBScript.  I need to make an HTTP call to an address and save it as an XML File.  I am pretty good with VB but I have never done this before, so if someone could nudge me in the right direction it would appreciated.

Question by:99Times
    LVL 44

    Accepted Solution

    Hi 99Times,

    you could try something like

    ' declare objects
    Dim xmlhttp, xmldoc
    ' create objects
    Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
    Set xmldoc = CreateObject("MSXML2.DOMDocument")
    ' put url of xml here
    xmlhttp.Open "GET", "", False
    ' send the order for this file out
    ' put the return doc in the local xml document object
    xmldoc.loadXML (xmlhttp.responseXML.XML)
    ' save to file
    xmldoc.Save "c:\testmenow.xml"

    share what you know, learn what you don't
    LVL 3

    Author Comment

    that worked great.  thanks!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now