I'm trying to download the QR code for my products using googleapis.com, I'm using this code in the Modules called: modHtthGet:
Public Sub httpGet(sourcePath As String, destinationPath As String)
Dim xmlHTTP
Dim contents
Dim oStr
Set xmlHTTP = CreateObject("Microsoft.XMLHTTP")
xmlHTTP.Open "GET", sourcePath, False
xmlHTTP.Send
contents = xmlHTTP.ResponseBody
Set oStr = CreateObject("ADODB.Stream")
oStr.Mode = adModeReadWrite
oStr.Type = adTypeBinary
oStr.Open
oStr.Write (contents)
oStr.SaveToFile destinationPath, adSaveCreateOverwrite
End Sub
then I call it from my form using the code:
Private Sub Command53_Click()
httpGet "https://chart.googleapis.com/chart?cht=qr&chs=150x150&choe=UTF-8&chld=L&chl=" &
Me.Pro, _
"C:\FolderToDownload\" & Me.Product_Code & ".jpg"
End Sub
that will download the QR code to the folder, all goes fine but if the Product_code in Arabic characters then I get an empty or wrong QR code
I tried many way to resolve the problem but cannot, I hope someone can help..
Thanks n advance