Simulate "Save Target As" using MSHTML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #1

    Simulate "Save Target As" using MSHTML

    Does anyone know how to simulate the right click "Save Target As" using
    MSHTML?

    I find that I can navigate through the LinksCollection on any given page but
    often these links are links to files (*.doc, *.xls etc). If I follow the
    link, it will open the document, but I am interested in saving it. Any ideas?
  • Cor Ligthert [MVP]

    #2
    Re: Simulate "Save Target As" using MSHTML

    John,

    Not that I have directly the answer, know that if you reuse HTML the
    behaviour will be as Interenet explorer.

    Therefore you can not save unintended the doc somewhere on disk. However you
    can save the outertext from the HTML tag what is beside the first header
    mostly complete the page.

    I hope this helps,

    Cor


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Simulate "Save Target As" using MSHTML

      "John" <John@discussio ns.microsoft.co m> schrieb:[color=blue]
      > Does anyone know how to simulate the right click "Save Target As" using
      > MSHTML?
      >
      > I find that I can navigate through the LinksCollection on any given page
      > but
      > often these links are links to files (*.doc, *.xls etc). If I follow the
      > link, it will open the document, but I am interested in saving it.[/color]

      You could download the file using 'WebClient.Down loadFile'.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • John

        #4
        Re: Simulate &quot;Save Target As&quot; using MSHTML

        Thanks Mr. Wagner. That is exactly what I needed.

        "Herfried K. Wagner [MVP]" wrote:
        [color=blue]
        > "John" <John@discussio ns.microsoft.co m> schrieb:[color=green]
        > > Does anyone know how to simulate the right click "Save Target As" using
        > > MSHTML?
        > >
        > > I find that I can navigate through the LinksCollection on any given page
        > > but
        > > often these links are links to files (*.doc, *.xls etc). If I follow the
        > > link, it will open the document, but I am interested in saving it.[/color]
        >
        > You could download the file using 'WebClient.Down loadFile'.
        >
        > --
        > M S Herfried K. Wagner
        > M V P <URL:http://dotnet.mvps.org/>
        > V B <URL:http://classicvb.org/petition/>
        >
        >[/color]

        Comment

        Working...