![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
how to save internet pages (pdf)
Hi all
Can anyone tell me how to save pdf files on the internet with VB. The pdf files are numbered sequentially, so let's say the URL is: "http:\\www.abc.com\page01.pdf" "http:\\www.abc.com\page02.pdf" "http:\\www.abc.com\page03.pdf" etc. I've been manipulating a sample program (ActXDoc.vbp), so that it produces these files just by clicking a button. But it is very tiresome to have to save them all by hand. Is there someway to automize this proces and save these pdf's directly into a file on the harddisk? Any help is greatly appreciated. Thank you. Margreet Mol |
|
|||
|
Re: how to save internet pages (pdf)
MHMol wrote:
> Hi all > Can anyone tell me how to save pdf files on the internet with VB. > The pdf files are numbered sequentially, so let's say the URL is: > > "http:\\www.abc.com\page01.pdf" > "http:\\www.abc.com\page02.pdf" > "http:\\www.abc.com\page03.pdf" > etc. > > I've been manipulating a sample program (ActXDoc.vbp), so that it produces > these files just by clicking a button. But it is very tiresome to have to > save them all by hand. Is there someway to automize this proces and save > these pdf's directly into a file on the harddisk? Use the Inet transfer control (or inet API) to download the URL. It makes no difference what file type it is. -- Dean Earley (dean.earley@icode.co.uk) i-Catcher Development Team iCode Systems |
|
|||
|
Re: how to save internet pages (pdf)
And lets not forget the automization... put the part number into a FOR-NEXT
loop along with the FORMAT function to set the URL name... Dim x As Long Dim URL As String For x = 0 To 3 URL = "http:\\www.abc.com\page" + Format(x,"0#) + ".pdf" 'insert download function here -- example: Call Dload(URL) DoEvents Next x "Dean Earley" <dean.earley@icode.co.uk> wrote in message news:4781ee07$0$13926$fa0fcedb@news.zen.co.uk... > MHMol wrote: >> Hi all >> Can anyone tell me how to save pdf files on the internet with VB. >> The pdf files are numbered sequentially, so let's say the URL is: >> >> "http:\\www.abc.com\page01.pdf" >> "http:\\www.abc.com\page02.pdf" >> "http:\\www.abc.com\page03.pdf" >> etc. >> >> I've been manipulating a sample program (ActXDoc.vbp), so that it >> produces these files just by clicking a button. But it is very tiresome >> to have to save them all by hand. Is there someway to automize this >> proces and save these pdf's directly into a file on the harddisk? > > Use the Inet transfer control (or inet API) to download the URL. > It makes no difference what file type it is. > > -- > Dean Earley (dean.earley@icode.co.uk) > i-Catcher Development Team > > iCode Systems |
|
|||
|
Re: how to save internet pages (pdf)
Thank you for your reaction.
I think you are right, this control is what I have to use. But I can't get it to work yet. I suppose I have to use the following code: Inet1.Execute txtURL.Text, _ "GET GetThis.txt C:\MyDocuments\GotThis.txt" The above I copied from the available example. txtURL.Text is my URL (http:// etc. etc.), but what do I use after the GET operation? As it is now, it doesn't work. The Help function doesn't give me any clue at all what this 'GetThis.txt' and 'C:\MyDocuments\GotThis.txt' is. And, as I mentioned before, I'm not retrieving text, but a pdf. Thanks for helping!! Margreet Mol "Dean Earley" <dean.earley@icode.co.uk> wrote in message news:4781ee07$0$13926$fa0fcedb@news.zen.co.uk... > MHMol wrote: >> Hi all >> Can anyone tell me how to save pdf files on the internet with VB. >> The pdf files are numbered sequentially, so let's say the URL is: >> >> "http:\\www.abc.com\page01.pdf" >> "http:\\www.abc.com\page02.pdf" >> "http:\\www.abc.com\page03.pdf" >> etc. >> >> I've been manipulating a sample program (ActXDoc.vbp), so that it >> produces these files just by clicking a button. But it is very tiresome >> to have to save them all by hand. Is there someway to automize this >> proces and save these pdf's directly into a file on the harddisk? > > Use the Inet transfer control (or inet API) to download the URL. > It makes no difference what file type it is. > > -- > Dean Earley (dean.earley@icode.co.uk) > i-Catcher Development Team > > iCode Systems > |
|
|||
|
Re: how to save internet pages (pdf)
If you're using an Inet object, as indicated by the example you
found, you'd probably do best with an OpenURL operation for your download method... Example... Public Sub Down_Load(NetModule As Inet, strURL As String, strFolder As String) Dim f As Integer Dim b() As Byte NetModule.AccessType = icUseDefault b = NetModule.OpenURL(strURL, icByteArray) f = FreeFile Open strFolder + "\" + strURL For Binary As #f Put #f, , b Close #f While NetModule.Stillexecuting = True DoEvents Wend End Sub ' ' ' Call Down_Load(Inet1.Name, txtURL.Text, strDestinationFolder.Text) ' ' ' That is the exact Sub I use in my "Grabber", "GetApod", and "AdminPanel" applications, and it hasn't failed me yet for snagging a file of ANY type from the "net". "MHMol" <nospam_mhm0l@hotmail.com> wrote in message news:4783e4ee$0$18862$bf4948fe@news.tele2.nl... > Thank you for your reaction. > I think you are right, this control is what I have to use. But I can't get > it to work yet. > I suppose I have to use the following code: > > Inet1.Execute txtURL.Text, _ > "GET GetThis.txt C:\MyDocuments\GotThis.txt" > > The above I copied from the available example. > > txtURL.Text is my URL (http:// etc. etc.), but what do I use after the GET > operation? As it is now, it doesn't work. The Help function doesn't give > me any clue at all what this 'GetThis.txt' and > 'C:\MyDocuments\GotThis.txt' is. > And, as I mentioned before, I'm not retrieving text, but a pdf. > > Thanks for helping!! > > Margreet Mol > > > > "Dean Earley" <dean.earley@icode.co.uk> wrote in message > news:4781ee07$0$13926$fa0fcedb@news.zen.co.uk... >> MHMol wrote: >>> Hi all >>> Can anyone tell me how to save pdf files on the internet with VB. >>> The pdf files are numbered sequentially, so let's say the URL is: >>> >>> "http:\\www.abc.com\page01.pdf" >>> "http:\\www.abc.com\page02.pdf" >>> "http:\\www.abc.com\page03.pdf" >>> etc. >>> >>> I've been manipulating a sample program (ActXDoc.vbp), so that it >>> produces these files just by clicking a button. But it is very tiresome >>> to have to save them all by hand. Is there someway to automize this >>> proces and save these pdf's directly into a file on the harddisk? >> >> Use the Inet transfer control (or inet API) to download the URL. >> It makes no difference what file type it is. >> >> -- >> Dean Earley (dean.earley@icode.co.uk) >> i-Catcher Development Team >> >> iCode Systems >> > > > |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|