Link to home
Start Free TrialLog in
Avatar of Daniel Pineault
Daniel Pineault

asked on

How to Capture an Image of an Access WebBrowser Control

How can I capture an image (jpg, png, gif - some common image type) of the entire content (not just what in currently in the view, but the entire scrollable webpage) of a webbrowser control in an Access database form?
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

You can do a web search of "scrollable screenshot", ...to see some popular utilities for doing this.

There are some things to consider when using a webbrowser control.
1. Its functionality is limited.
The name implies that it might be a mini version of IE, Firefox, ....or Chrome.
In reality, ...it is just a simple way to display a webpage (or formatted HTML text) in an access form.

2. Because the control has to fit inside a form, ...you may have issues with some sites designed to be viewed at different resolutions
(especially websites designed for "Wide Screen" resolutions.)

A lot of the scrollable screenshot utilities will scroll (Vertically) down a page.
It is not clear if they can scroll Horizontally (for widescreen data)
Or if they can "see inside" the webbrowser control.

My guess is that they can scroll the "form" itself, ...but not be able to reach inside the webrowser control.

This is all based on the last time i researched the webrowser control (Acc2016), ...so things may have changed since then.

Lets see what others may post.

JeffCoachman
Now there seems to be two "webbrowser controls for Ms Access
The first is just an MS Access control that you can get right form the basic controls list.
With this control, ...all you have to do is set the webpage you want to go to, ...and that is it.

The second is the Active x web browser control.
You get this from the Active X section of the basic controls screen.
Ypu have to set the webpage something like this:
Me.YourWebbrowser.Navigate "http://www.google.com"

But here again, ...it is not clear if any of the scrollable screen capture utilities can read "inside" these controls...
Avatar of Daniel Pineault
Daniel Pineault

ASKER

I am looking for a VBA solution.  As I can't guarantee what will be installed on the end user's computer.

I am nearing a solution to scroll the webbrowser's content to allow me to take screenshots, but I don't know how I can combine them into a single image.

As for 2 webbrowser controls, the ActiveX is the older control which has been deprecated by the new one (this is the one I'm using, I believe it is Access 2010+).
If you capture 2 images (or more) as byte array you can make a compare between the 2 arrays to find the common point and stitch them together
ASKER CERTIFIED SOLUTION
Avatar of Daniel Pineault
Daniel Pineault

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial