Microsoft Access: Edge Browser Control is finally here :) (1 Viewer)

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
Hello,

With Microsoft's new release of the Edge browser control, which is currently available to Office Insiders and beta subscribers. I see some challenges when it comes to navigating to local html files. Can anyone test and advise if there is a way to navigate to local html file paths (not localhost / web http paths). You may notice that it instead opens a web browser popup.

As there is no official documentation available yet, I was wondering if anyone has tested this and could share any tips or tricks to make it work with local files located on a path such as CurrentProject.Path, rather than on localhost or the web? Let's keep this thread open for discussion and sharing of any potential solutions/tips for others. Here is the tip for the current-channel office365 users to try the new browser control.

If you are not an office insider but using current channel for Office365 and want to try out the new edge browser control, follow these steps:
  • Right-click on your legacy web browser control (if not add a web browser control in form design view).
  • Choose Change To and then select the new browser control.

Enjoy!

1678829671694.png
 

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,258
@Mohsin Malik
Good question. It never occurred to me to try local files in my own tests!

@shanegroff from the Access team has asked me to post this response on his behalf

To open a local HTML file in the Edge browser you need to add https://msaccess/ before the filepath in the browser control source
e.g. ="https://msaccess/G:\MyFiles\ExampleDatabases\GetCurrentGeoLocation\geolocal.html"


I've tried it with HTML files and it worked, though there was a noticeable delay before the file opened.
I also found issues with internal links to e.g. image files. It seems each of those paths need prefixing as well

I tried again with other local files such as PDFs and it didn't work for me.
I may be doing something wrong or perhaps that's a known issue still being worked on

I've reported back to the Access team and will update if I hear more
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:45
Joined
May 7, 2009
Messages
19,246
You may notice that it instead opens a web browser popup.
then it is no different from the current web browser control?
 

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
@Mohsin Malik
Good question. It never occurred to me to try local files in my own tests!

@shanegroff from the Access team has asked me to post this response on his behalf

To open a local HTML file in the Edge browser you need to add https://msaccess/ before the filepath in the browser control source
e.g. ="https://msaccess/G:\MyFiles\ExampleDatabases\GetCurrentGeoLocation\geolocal.html"


I've tried it with HTML files and it worked, though there was a noticeable delay before the file opened.
I also found issues with internal links to e.g. image files. It seems each of those paths need prefixing as well

I tried again with other local files such as PDFs and it didn't work for me.
I may be doing something wrong or perhaps that's a known issue still being worked on

I've reported back to the Access team and will update if I hear more
@isladogs Thank you for sharing this information and workaround. The suggestion to add "https://msaccess/" before the file path in the browser control source worked for local HTML files, although I can confirm that there was a delay in opening them. I appreciate you taking the time to report this to the Access team and keeping us informed.

I also attempted to load local image and PDF files in the web browser, but was unsuccessful.
 

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
then it is no different from the current web browser control?
Alot of differences and you can run any modern framework / websites in the new browser control. However, I see some challenges while loading local content / files in the control.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 15:45
Joined
Feb 19, 2013
Messages
16,674
other local files such as PDFs and it didn't work for me.
May or may not be relevant but with IE browser control I can't open PDF's in the browser control unless I install acrobat reader (I use 2010 32bit and 365 64bit) . Otherwise it just (asks to) open the file as if I'd double clicked on the file in windows explorer. There may be other alternatives to acrobat reader, I don't know.

So perhaps reinstalling acrobat reader to get the latest version solves the problem?

I use the web browser control in a number of my accounting apps to view pdf's, image, text and mht files among others so kind of important for me to know it all works! And preferably without any significant delay
 

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,258
Responding to a few points from above:

@Mohsin Malik
You may notice that it instead opens a web browser popup.
Unable to replicate.
For me, using e.g. Me.EdgeBrowser0.Navigate URL opens the specified URL in the browser control
This is particularly useful if you want to switch URLs for the browser control using code

Good points:
1. Many sites do not render correctly in the old browser. The new browser fixes that

2. All sites that I've tested load faster in the new control

3. The new browser can definitely open pages that are blocked to the IE browser
For example, I've already successfully opened HTML files which use Google Javascript API - blocked in the IE browser

4. Sites that use Javascript e.g. Wordpress sites open without errors. In IE browser, there are script errors

Issues:
1. As stated above, using https://msaccess/ as a prefix allows local HTML files to open but loading time is painfully slow
I've reported this as an issue

2. Having to prefix the paths of any internal image or file links in a local HTML file isn't realistic for me.
I don't have to do this in the IE browser control

3. Local PDFs have now been confirmed as a known issue and this will be addressed before general release.
Its definitely nothing to do with whether you have e.g. Acrobat Reader installed

4. I've asked about loading other local files e.g. text, docx etc. Will let you know if I get any feedback I can use here
 

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
Thanks for reporting and providing your feedback, @isladogs . I appreciate your insights. It seems that using the https://msaccess prefix for local HTML files has caused an additional issue with events such as ExecuteJavascript no longer functioning. Please let me know if there is another way to do this. Also I think the security team should consider rethinking their approach and possibly add a setting in access options (trust-center) to enable the full-mode of Edge instead of the restricted mode. This could help address some of the compatibility issues that users are experiencing.

Private Sub Form_Load()
Me.EdgeBrowser0.Navigate "https://msaccess/C:\Users\WORK\Demo\LocalFile.html" 'ExecuteJavascript does not work for local html files
'Me.EdgeBrowser0.Navigate "https://www.google.com" 'ExecuteJavascript works fine for http, https protocol
End Sub

Private Sub EdgeBrowser0_DocumentComplete(URL As Variant)
Me.EdgeBrowser0.ExecuteJavascript ("alert('hello from access');")
End Sub
 

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
Responding to a few points from above:

@Mohsin Malik

Unable to replicate.
For me, using e.g. Me.EdgeBrowser0.Navigate URL opens the specified URL in the browser control
This is particularly useful if you want to switch URLs for the browser control using code

To reproduce this popup issue, please try a local html file path without https://msaccess prefix fix, for-example see below:

Private Sub Form_Load()
Me.EdgeBrowser0.Navigate "C:\Users\WORK\Demo\LocalFile.html"
End Sub
 

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
Good Point:

The Web Browser Control works great in both the tabular and columnar layout of Microsoft Access reports.

1678908834328.png
 

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
Good Point:

The Edge Browser Control works great in Microsoft Access Continuous Form view.

1678908969142.png
 

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,258
Re posts #8 & #9
I still can't reproduce your issues

Javascript works fine with a local HTML file using .Navigate
1678914712764.png


Javascript also works fine with a local HTML file if you use .ControlSource instead of .Navigate
1678913006811.png


Similarly, a local HTML file opens in the browser control providing you use the prefix as described
1678913370363.png


If you omit the prefix, it does indeed open in an external browser window. That's why the Access team member said to use the prefix.

The above screenshot also illustrates my comment about image links using relative paths not being handled correctly in the new browser

Hope that helps
 

Mohsin Malik

Registered User.
Local time
Today, 18:45
Joined
Mar 25, 2012
Messages
175
If you omit the prefix, it does indeed open in an external browser window. That's why the Access team member said to use the prefix.

The above screenshot also illustrates my comment about image links using relative paths not being handled correctly in the new browser

Hope that helps
Thank you for your comment and for sharing your experience/screenshots with local HTML files in Access. I am positive that I might be doing something wrong and will try again :)

Regarding the prefix, I agree that using https://msaccess prefix for local HTML files seems to be the solution for avoiding the external browser window opening. I have tested and can confirm that image links using relative paths not being handled correctly in the new browser.

Thanks again for your valuable insights.

1678917448704.png
 

Josef P.

Well-known member
Local time
Today, 16:45
Joined
Feb 2, 2023
Messages
847
then it is no different from the current web browser control?
The property "Object" is missing in the new control.
The new control is probably similar to "Modern Chart" as a new variant but not 1:1 compatible to the predecessor.

Note:
I was about to try Better-Access-Charts with it. Unfortunately, switching to the new control was not enough, because Thomas uses WebBrowserControl.Object.Document to load the content. That will then probably have to be switched to creating a file.
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,258
The property "Object" is missing in the new control.

Note:
I was about to try Better-Access-Charts with it. Unfortunately, switching to the new control was not enough, because Thomas uses WebBrowserControl.Object.Document to load the content. That will then probably have to be switched to creating a file.
Correct. I mentioned that point when I was bug testing some months ago with the maps I showed in post #12

In the past I used code similar to this to retrieve the geo-coordinates from the 2 textboxes on the local HTML file

Code:
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
'Set objIE = CreateObject("MSEdge.Application") '- doesn't work - can we create an Edge object? If so, what is the correct syntax here

...
sngLat = objIE.Document.GetElementById("latbox").Value
sngLong = objIE.Document.GetElementById("lngbox").Value
...

I am currently trying to find a different way of grabbing those values using .ExecuteJavascript sngLat and/or .RetrieveJavascriptValue sngLat
So far unsuccessfully!

For info, I notified Thomas as soon as the new browser control was made available to the Insiders channel
He hopes to update his Better Access Charts to use the latest version release of charts.js
 

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,258
For info, the first batch of documentation has been released for the new Edge browser control object

Further documentation will follow

Joe Jimenez is the member of the Access team primarily responsible for the new Edge browser control.
Joe has asked me to pass on the following information on his behalf

We added a new Trusted Domains property because by default you can't navigate away from the domain the browser starts at:

If an external browser window pops up, often this means a redirect occurred, but if the site you redirected to is in your trusted domains then it will not pop up the external browser.

A local file without the msaccess prefix will always open up the external browser though, as the webview is restricted from accessing the file system for security reasons.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:45
Joined
May 7, 2009
Messages
19,246
The property "Object" is missing in the new control.
although it is Listed on its Property...
i think it is another Raw "control" since it is new and more bugs to come (you know MS).
 

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,258
although it is Listed on its Property...
i think it is another Raw "control" since it is new and more bugs to come (you know MS).
If you click on the Object link under the EdgeBrowserControl documentation it takes you to the old WebBrowserControl article.
There may well be other links to tidy up

As already stated, there are some known issues currently being worked on. Wider testing in the Insiders channels may well expose new issues not already reported. That's why the A-team is asking for any feedback so it can be dealt with before wider release to all users (hopefully next month)

I suggest both positive & negative feedback would be useful
 
Last edited:

GPGeorge

George Hepworth
Local time
Today, 07:45
Joined
Nov 25, 2004
Messages
1,994
It's brilliant. More than a year ago, several sites I used to display in the old web browser control stopped working at all. I bit the bullet and added the insider channel to get this new Edge-based Web Browser control. One minor code change was needed to get it to work. This was a line of code added to suppress error messages in the prior version.

This line fails in the form's Load event. Removing it was all that was needed to get the web sites to load again.

Me.WebBrowser1.Object.Silent = True

I imagine I'll find further hurdles and changes, as Colin's already noted above. Nonetheless, Day 1, Hour 1 results are very encouraging.
 

Users who are viewing this thread

Top Bottom