How to load images on Sharepoint to as image control

Brass Contributor

Good afternoon
I made a form in Microsoft Forms, so that they send me cell phone pictures.
These images come to me with a Sharepoint link, for example:
"https://xxxxxxxcom.sharepoint.com/sites/es_sharepoint_communicationsite/Shared%..."

What happens is that the image that is downloaded is black. If I test it with any image from the internet, it works fine.
I think the fact is that the image is on Sharepoint and the link I receive cannot be accessed externally.

Can anyone help me resolve this issue? Thank you for your help

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

Sub CommandButton1_Click()
    Dim imgsrc As String
    Dim dlpath As String
    imgsrc="https://static.kbb.com.br/Uploads/ResearchTools/News/3099/31b6ebf5-06f6-42d0-91d8-b5e6aae08a35_1365x1024.jpg"
    dlpath = "C:\Meu_Backup\"
    URLDownloadToFile 0, imgsrc, dlpath & "HK Skyline.jpg", 0, 0
    Form_01_Entrada.MultiPage1.Pages(2).Image4.Picture = LoadPicture("C:\Meu_Backup\HK Skyline.jpg")
End Sub
0 Replies