Results 1 to 2 of 2
  1. #1
    researchRE is offline Novice
    Windows XP Access 2016
    Join Date
    Sep 2018
    Posts
    7

    Embed Bing Map into Access Report

    Hello,



    Is it possible to embed a Bing's map into an Access report? We need two types of images. One is an aerial of the top of the building and then a second is a map that shows the streets. I know we are able to upload an image, but can a bing's map photo be embedded into the report so that the user can see it without clicking a hyperlink?

    Thanks!

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974

    Post

    Yes you can - i don't use Bing but its easy enough with Google and I see no reason why it would be a problem.

    However I had no luck trying to embed images direct from a website onto a report
    Instead my approach is to download the required map(s) as image files.

    Place this code in a standard module

    Code:
    'conditional compiling for use in 32-bit/64-bit systems#If VBA7 Then
        Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias _
                "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal _
                szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
      
    #ElseIf Win64 Then
        Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias _
                "URLDownloadToFileA" (ByVal pCaller As LongPtr, ByVal szURL As String, ByVal _
                szFileName As String, ByVal dwReserved As LongPtr, ByVal lpfnCB As LongPtr) As LongPtr
       
    #Else
        Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
                "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal _
                szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
    #End If
    
    Public Function DownloadFilefromWeb(url As String, FileName As String) As Boolean
        DownloadFilefromWeb = URLDownloadToFile(0, url, FileName, 0, 0)
    End Function
    Use code similar to this to download & display the map image in a form/report

    Code:
     'Download map from specified strURL to specified path strFilePath
        DownloadFilefromWeb strURL, strFilePath
        DoEvents
       'display image 
        Me.Image0.Picture = strFilePath
    HTH
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 08-04-2015, 01:33 PM
  2. Replies: 5
    Last Post: 07-29-2015, 02:15 PM
  3. Bing Maps
    By sdel_nevo in forum Forms
    Replies: 10
    Last Post: 09-23-2014, 12:19 PM
  4. Cannot Embed bmp images with Access 2010
    By DelbyJones in forum Access
    Replies: 7
    Last Post: 07-31-2012, 08:26 AM
  5. embed mailto in access sharepoint form
    By johnhoare65 in forum SharePoint
    Replies: 2
    Last Post: 12-23-2011, 03:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums