Source Code of webpage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sanka
    New Member
    • Sep 2007
    • 14

    Source Code of webpage

    I would just like to know if it is possible to get the source code of a webpage through VB in Access. I need to copy the code to another webpage after that.

    If anyone knows how to do that please let me know

    Thanks
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    It is, just create a form with the Webbrowser control.
    Now you can point to an URL with:
    Code:
    Me.webbrowser1.Navigate URL:="<the needed URL e.g. from your form>"
    When the page is visible you need to use:
    Code:
    Dim doc As MSHTML.HTMLDocument
    Set doc = Me.webbrowser1.Document
    To get the browser data available and personally I use only selected text on such a page like:

    Code:
    strSelectedText = doc.selection.createRange().Text
    There's more to this, but you'll have to check the HTMLDocument options to get it all.

    Nic;o)

    Comment

    Working...