WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Saving data with MSIE and OLE

Keywords: 	 Saving data with MSIE and OLE.wbt

Save the contents of any web page (or frame within the page) by navigating the WebBrowser object hierarchy. Try this to obtain the contents of a "frameless" page. This should work with IE 4.01 or greater:

#DefineSubRoutine startMSIE(url)
   Browser = ObjectOpen("InternetExplorer.Application")
   Browser.addressbar = @TRUE
   Browser.statusbar = @TRUE
   Browser.menubar = @TRUE
   Browser.toolbar = @TRUE
   browser.visible = @TRUE
   browser.navigate(url)
   WaitForPageLoad()
   Return(browser)
#EndSubRoutine

#DefineSubRoutine WaitForPageLoad()  ; assume Browser
   While browser.busy || browser.readystate == 1
      TimeDelay(0.5)
   EndWhile
   bdoc=Browser.document
   While bdoc.ReadyState != "complete"
      TimeDelay(0.5)
   EndWhile)
   ObjectClose(bdoc)
   Return
#EndSubRoutine





url="http://www.winbatch.com"

StartMSIE(url)
WaitForPageLoad()
BrowserDoc = browser.Document

BrowserBody = BrowserDoc.Body
BrowserPage = BrowserBody.CreateTextRange

; The HTML of the page
BrowserPageHTML = BrowserPage.HTMLText

; The Text (only) of the page
BrowserPageText = BrowserPage.Text

ObjectClose(browser)







Article ID:   W14911
File Created: 2004:08:03:15:47:28
Last Updated: 2004:08:03:15:47:28