Display a web page (automatically) without any navigation ctls. How to disable navigation ctls built into individual WEB PAGES?

I have an xl-based system for 'clipping bits' of web pages to create images.
To avoid copyright issues, I must be certain of the url of each image that is 'clipped'.

Currently -  I pre-identify the url and call it:
    Set oIE = CreateObject("InternetExplorer.application") (or via google)
    oIE.Visible = True
    oIE.navigate ("http://bbc.co.uk")
    oIE.Visible = True
    oIE.AddressBar = 0
    oIE.StatusBar = 0
    oIE.Toolbar = 0
    oIE.MenuBar = 0

Then make snapshot to get the graphic:
    Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
- then crop it.

QUESTION:
Although I suppress the oIE. 'bars' (code above), I cant disable any navigation tools that are built into the WEB PAGE from being used to navigate to other pages.

Is there a way of disabling navigation tools that are built into individual WEB PAGES?


Thanks!
Kelvin
Kelvin4Asked:
Who is Participating?
 
Fabrice LambertConnect With a Mentor Fabrice LambertCommented:
Hi,

What about using a form with a webBrowser object ?
0
 
Kelvin4Author Commented:
Fabrice:

.... Investigating quality of image (for screenshot)

Thanks!
Kelvin
0
 
Fabrice LambertFabrice LambertCommented:
Sorry, I do not understand what you mean by "Investigating quality of image (for screenshot)"

Plus, the only legal way to "avoid copyright issues" is to ask the author for permission to use the images.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
Kelvin4Author Commented:
Fabrice:
Its running. Good quality graphic, thanks.

However, I  need to disable navigation controls within the displayed page.
I must also retain scroll bars functions, so I can read the whole web page.

Can you help with event code to intercept the clicking of navigation controls?

Thanks
Kelvin
0
 
Kelvin4Author Commented:
Sorry, our msgs crossed.
I just wanted to see what the quality of web images looked like on a UserForm ctl. They look great.

Copyright: agreed. What I'm trying to do is to ensure that the project always saves the url for a 'captured' image, so I can be sure permission is requested, and requested  accurately.

Kelvin
0
 
Kelvin4Author Commented:
The following code loaded a web url (UserForm_Initialize()) and prevented the clicking of hyperlinks in the resultant web page (WebBrowser1_BeforeNavigate2).

 cancelNavigate (As Boolean) controlled when WebBrowser1_BeforeNavigate2 set Cancel = true, so that cancel = false when the web page was loading.

If readers have improvements I'd be glad to know them. At present List boxes in web pages OPEN, but items cannot be selected when cancelNavigate = true. To close the listBox, simply click the list box Caption a second time.

Option Explicit
Private cancelNavigate As Boolean

Private Sub UserForm_Initialize()
    cancelNavigate = True
    Me.WebBrowser1.Navigate "http://bbc.co.uk"
    cancelNavigate = False
End Sub

Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    If cancelNavigate = False Then
        'MsgBox "Cancel = true"
        Cancel = True
    End If
End Sub
0
 
Kelvin4Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.