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

561414

Active member
Local time
Yesterday, 18:56
Joined
May 28, 2021
Messages
280
Thanks, isladogs
Then, OP, would this work perhaps?
Code:
Private Sub EdgeBrowser0_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Me.txtHTML = pDisp.Document.getElementsByTagName("table")(0).innerHTML
End Sub
 

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
Sorry but when I checked the code before replying in post #100, the links from the Edge browser object led back to the old web browser control webpage

I've just checked using the Edge browser control and pDisp is no longer an argument for this event. The code now for this event is:
Code:
Private Sub EdgeBrowser0_DocumentComplete(URL As Variant)

I've amended post #100

Apologies for the misinformation earlier.
 

561414

Active member
Local time
Yesterday, 18:56
Joined
May 28, 2021
Messages
280
Oh, but the automation document object must be there in some way, right? maybe
Code:
Private Sub EdgeBrowser0_DocumentComplete(URL As Variant)
    Me.txtHTML = Me.EdgeBrowser0.Document.getElementsByTagName("table")(0).innerHTML
End Sub
If they fused the browser with the control, then it "should?" work like that, right?
 

DalynSoft

New member
Local time
Today, 09:26
Joined
May 23, 2023
Messages
28
I have been using some code which creates a local file for mapping sites onto Google Maps. It has worked fine when the file is opened up directly in a browser.

When I try to open the file in the new web browser control the web page doesn't appear.

Does anyone have experience with this that I could share my file with to see where I am going wrong?
 

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
Is the map to be viewed as an image file in an image control or as a local HTML file in the edge browser control?
If the latter, you must prefix the path with https://msaccess/ followed by the full file path
 

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
Oh, but the automation document object must be there in some way, right? maybe
Code:
Private Sub EdgeBrowser0_DocumentComplete(URL As Variant)
    Me.txtHTML = Me.EdgeBrowser0.Document.getElementsByTagName("table")(0).innerHTML
End Sub
If they fused the browser with the control, then it "should?" work like that, right?

No. That isn't valid code either. Daniel Pineault has just published a useful reference guide. Its not yet complete but does cover this area
 

DalynSoft

New member
Local time
Today, 09:26
Joined
May 23, 2023
Messages
28
It is a local file and I have added the prefix. I can open simple "hello World" html files ok but it seems to be something with Google Maps itself. I can share the file itself if this will help
 

561414

Active member
Local time
Yesterday, 18:56
Joined
May 28, 2021
Messages
280
No. That isn't valid code either. Daniel Pineault has just published a useful reference guide. Its not yet complete but does cover this area
Thanks.
By the looks of it, they removed the vba automation that the previous version could use and left javascript handle it all. Seems handy, too bad I can't test it.
 

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
@DalynSoft
You're welcome to upload a cut down version of your app but I do wonder why you're saving Google maps locally as HTML files.
Why not just load the googleapis.com/maps URL into a browser control as shown in the annotated map examples below or save it as a local image file?

1684836640511.png
 

DalynSoft

New member
Local time
Today, 09:26
Joined
May 23, 2023
Messages
28
@DalynSoft
You're welcome to upload a cut down version of your app but I do wonder why you're saving Google maps locally as HTML files.
Why not just load the googleapis.com/maps URL into a browser control as shown in the annotated map examples below or save it as a local image file?
My application stores locations of building sites and coordinates for trenches between sites. Users select which sites and trenches they want shown on the map, then a local html file is created that includes all the data, calculates the google map size to include all the selected sites, then plots them onto a map with custom markers and labels. Attached is an example of a created file.

If there is a better way of doing this I am open to suggestions. One idea was to load the html directly into the control, but I don't want to start playing with that until I know that the code can be run.
 

Attachments

  • SiteMapPointsEdgeTest.zip
    2.5 KB · Views: 98

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
My application stores locations of building sites and coordinates for trenches between sites. Users select which sites and trenches they want shown on the map, then a local html file is created that includes all the data, calculates the google map size to include all the selected sites, then plots them onto a map with custom markers and labels. Attached is an example of a created file.

If there is a better way of doing this I am open to suggestions. One idea was to load the html directly into the control, but I don't want to start playing with that until I know that the code can be run.

I've had a quick test & can confirm that the map image isn't loading

I'll look at it again later when I have time but unlikely to be today. Hopefully someone else will look at it as well.

In the meantime, I suggest you
a) try the attached local HTML file (add your own API key)
b) look at my 3-part series of articles (and video) on annotating Google maps in Access.

The articles pre-date the new Edge browser control but that shouldn't matter for this purpose
Although my examples are all based on UK postcodes, the principle appears to be the same as what you are doing.
 

Attachments

  • geolocal.zip
    1.3 KB · Views: 90

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
Oops! I've just replaced the attachment in post #111 with the zipped HTML file
 

DalynSoft

New member
Local time
Today, 09:26
Joined
May 23, 2023
Messages
28
1684884264678.png


I tried to send this reply but got this message (what was the problem?)
1684884317616.png
 

DalynSoft

New member
Local time
Today, 09:26
Joined
May 23, 2023
Messages
28
Oops! I've just replaced the attachment in post #111 with the zipped HTML file

Tested your HTML in both a browser, and in Access. Both work. This suggests to me the problem is with how google handles the marker paths in the google.maps.Marker variable (or how the new Access Control processes it?)
 

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
1. My code in those articles was entirely for building static maps. However, users can still drill down by selecting options on forms. I haven't needed to include street view.
2. New users are not allowed to post links until they reach a certain number of posts. For the benefit of others, the link above was

I haven't looked at their example database/code.
Suggest you contact the WSI site direct to ask if they have modified their code to work with the new Edge control
 

DalynSoft

New member
Local time
Today, 09:26
Joined
May 23, 2023
Messages
28
Thanks for your time - much appreciated. I have sent a message to them and am waiting for a response.
 

lauro

Member
Local time
Yesterday, 16:56
Joined
May 18, 2012
Messages
59
I would like to share my experiences with the new Edge Browser control and ask some questions.

I made simple database (1 table with addresses, 1 form, 1 report) and I tried to visualize both internet sites and local files.

That’s what I gathered:
  • Internet addresses
    • starting with “https://” are correctly opened in the new Edge Browser control
    • starting with “http://” are opened in my default browser (Firefox 113.0.1 (64 bit))
    • starting with “www” are not opened at all.
  • Local files: “.htm”, “.pdf”, “.docx”
    • Without “https://msaccess/”: They are opened quite fast in their application.
    • With "https://msaccess/":
      • Are opened in the new Web Browser control but not so fast (considering that the application is not opened) (or maybe I’m wrong it is opened but it is transparent).
      • “.htm and “.pdf” files are opened only if their name doesn’t have white space (the real name of the file can have %20 instead of white spaces, even if the name in the Access table has white spaces).
      • “.docx” gibberish.
  • Mixing local address (“.htm”, “.pdf”) and internet address
    • Mixing different type of local addresses is allowed, but mixing internet addresses and local addresses is not allowed.
    • It all depends from the first record: if it contains an internet address, then all subsequent internet addresses are correctly shown, but not the local ones; if it has a local address then only the local files are displayed.
    • Curiously enough, in reports it’s possible to mix local and internet addresses.
  • Reports correctly use the new control

Now my questions:
  • If the final user doesn't have Edge installed, does he have to install it to correctly see any content of the new web browser control?
    • I think the answer is YES
  • If the final user doesn't have Acrobat Reader installed, does he have to install it to correctly pdf files in the new web browser control?
    • Again the answer should be YES
  • If the final user has an older version of Access (for instance 2010) can he still use my database with the new web browser control?
    • I really don't know
  • If the final user doesn' have Access at all, but I could give (download) him the Access Runtime, will he be able to use my database with the new web browser control?
    • I really don't know. And which version?
Thanks for the attention,
Lauro
 

DalynSoft

New member
Local time
Today, 09:26
Joined
May 23, 2023
Messages
28
(Cross-posted in Access-D so that Shane Groff will see it as well)

Attached is a simplified version of my html file. It just requires putting in a Google API key. The only line that seems to be the problem when run in the Edge Web Control is the call to Google Maps. It work ok when it is opened directly in a web browser. Perhaps a bug in the control's processing of one of the following lines?

<script type="text/javascript" src="http://maps.google.com/maps/api/js?key= ReplaceWithGoogleKey "></script>

map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
 

Attachments

  • SiteMapPointsEdgeGoogleMapTest.zip
    1.1 KB · Views: 90
Last edited:

isladogs

MVP / VIP
Local time
Today, 00:56
Joined
Jan 14, 2017
Messages
18,246
(Cross-posted in Access-D so that Shane Groff will see it as well)

Attached is a simplified version of my html file. It just requires putting in a Google API key. The only line that seems to be the problem when run in the Edge Web Control is the call to Google Maps. It work ok when it is opened directly in a web browser. Perhaps a bug in the control's processing of one of the following lines?

<script type="text/javascript" src="http://maps.google.com/maps/api/js?key= ReplaceWithGoogleKey "></script>

map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

Alerting @JoeJimenezMicrosoft to your post
 

Users who are viewing this thread

Top Bottom