اخي الكريم تفضل الطريقة
قم بإدراج اطار صورة
الصق هذا الفكشن في اي مكان داخل VBA
Public Function DownloadImage(ByVal URL As String) As String
On Error GoTo catch
Dim oWinHTTP As Object
Dim FileNumber As Integer
Dim Destination As String
Dim buffer() As Byte
DoCmd.Hourglass True
Destination = CurrentProject.Path & "\tmp." & Mid$(URL, InStrRev(URL, ".") + 1)
Set oWinHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
oWinHTTP.Open "POST", URL, False
oWinHTTP.send
If oWinHTTP.Status = 200 Then
FileNumber = FreeFile
Open Destination For Binary Lock Read Write As #FileNumber
buffer = oWinHTTP.ResponseBody
Put #FileNumber, , buffer
Close #FileNumber
DownloadImage = Destination
End If
DoCmd.Hourglass False
finally:
Erase buffer
Set oWinHTTP = Nothing
Exit Function
catch:
DoCmd.Hourglass False
MsgBox "Error number" & Err.Number & vbCrLf & "Description : " & Err.Description, vbExclamation, "DownloadImage()..."
Close 'close all open files
Resume finally
End Function
بعد ان يتم تحميل الصورة و تخزينها في الذاكرة المؤقته يتم استدائها بنفس الرابط الذي تم تحميلها من
من خلال الكود التالي
Me.picture1.Picture = DownloadImage("http://stylis7.com/up/uploads/images/stylis7-4e2761ce34.png")
تفضل المثال
مثال لجلب الصورة من رابط.mdb