0

Ok, I have an ActiveX web browser control on an Access form.

I am loading a url into this control using the following code:

Dim webMain As Object

Set webMain = Me.WebBrowser2.Object
webMain.Navigate "http://stackoverflow.com"

However, this page has multiple DIV's and I only want to show one.

Thanks

John

HansUp
  • 95,961
  • 11
  • 77
  • 135
JMK
  • 27,273
  • 52
  • 163
  • 280
  • 1
    Hu…? Sultiple divs? Sure, why wouldn't it? Which one do you want to display, which ones do you want to hide? And most importantly: why?? – knittl Oct 17 '11 at 11:21
  • Thanks for the reply. The guys using this are working within a Microsoft Access Form on 19" screens so there's not a lot of real estate, I am only interested in one div in my form, as the other two are menu's which they don't need to use or see. They just need to fill in the form located within the main div and hit submit. Also, I'm obviously not sending them to StackOverflow, that's just there as an example. – JMK Oct 17 '11 at 18:27

1 Answers1

2

From your comment

I am only interested in one div in my form, as the other two are menu's which they don't need to use or see. They just need to fill in the form located within the main div and hit submit.

Well why bother with displaying HTML to them at all. Just collect the data on your Access form with Unbounded controls and POST the HTTP form yourself using MSXML2.ServerXMLHTTP or WinHttp.WinHttpRequest.5.1

For a sample see How can I send an HTTP POST request to a server from Excel using VBA?

Community
  • 1
  • 1
Conrad Frix
  • 51,984
  • 12
  • 96
  • 155