Hi guys,
As starts with the link I have (it won't work for you but it's not important):
http://cwzproxy.com:8080/STVService...id=&toolbar=true&savable=true&parentApfi=8712
This long link has not any *.PDF extensions but virtually it opens PDF.
I thought I could use this link to download the file using this code but it does not work. The file is corrupt.
Even if I cant use code to download that directly using the l inke, maybe I can control the Adobe Reader that opens the file (Starndard DC in my case), save it, close the window and loop to next one.
I tried something like this but it says there is no library:
Thanks!
As starts with the link I have (it won't work for you but it's not important):
http://cwzproxy.com:8080/STVService...id=&toolbar=true&savable=true&parentApfi=8712
This long link has not any *.PDF extensions but virtually it opens PDF.
I thought I could use this link to download the file using this code but it does not work. The file is corrupt.
Code:
Sub Downloadpdf ()
Dim myURL As String
myURL = "http://cwzproxy.com:8080/STVService/[...]=&toolbar=true&savable=true&parentApfi=8712"
Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
WinHttpReq.Open "GET", myURL, False
WinHttpReq.Send
myURL = WinHttpReq.ResponseBody
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write WinHttpReq.ResponseBody
oStream.SaveToFile ("C:\Users\Python\exampledoc.pdf")
oStream.Close
End Sub
Even if I cant use code to download that directly using the l inke, maybe I can control the Adobe Reader that opens the file (Starndard DC in my case), save it, close the window and loop to next one.
I tried something like this but it says there is no library:
Code:
Sub SavePDf()
Dim AcroApp As Acrobat.CAcroApp
Dim PdDoc As Acrobat.CAcroPDDoc
Dim avdoc As Acrobat.CAcroAVDoc
Set AcroApp = CreateObject("AcroExch.App")
Set avdoc = AcroApp.GetActiveDoc
If Not (avdoc Is Nothing) Then
Set PdDoc = avdoc.GetPDDoc
WasSaved = PdDoc.Save(PDSaveFull, "C:\Users\sobkoww\python.pdf")
End If
End Sub
Thanks!
Last edited: