Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Save Web based PDF files to Disk (VB 6)

    Got a small project that I'm having difficulty with:

    I've got a list of URLs that refer to web based *.PDf documents. I can access the relevent entry in the Access Table, but I can't seem to work out how to Download the file to a specified Directory. The urls work when pasted in the Address box in IE7

    The value of path1 is the URl and the value of Path 2 is the PDF document name that needs to be saved to: Cdfdocs

    Path1 = RS.Fields("Path").Value
    Path2 = Mid(Path1, 36)

    What is the Correct command that need to be refered to I've tried:

    Dim Fsys As New FileSystemObject
    Fsys.CopyFile oResult, "C:PDFdocs" & Path2, overwrite
    This does not work?? and alos Docmd with Access Library in References

    If your solution needs a specific reference to a code library please also advise.

    Gratitude in anticipation.
    Graeme

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save Web based PDF files to Disk (VB 6)

    See if you can use Modules: Internet Data Transfer Library from the Access Web.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Save Web based PDF files to Disk (VB 6)

    Hans Thanks Very Interesting.

    However, I can't get it working could you give me list of The References to Libraries that are needed to get this working as it dosn't seem to be recognising: InetTransferLib.HTTP as an Object ??

    Possibly I've not Applied it properly ? DO have to import anything into teh Add-Ins??

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save Web based PDF files to Disk (VB 6)

    I'm sorry, I don't have VB6 so I cannot test any of this.

  5. #5
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Save Web based PDF files to Disk (VB 6)

    Hans,

    I've changed my approach to Access

    It seems to be only for Access 97 Whenever I try to import the add-in into a Access 2000 Database (in 2007) it says it was for an earlier version. So I suspect I'm stuffed on this code.

    Is there any other advise you can give me??

    Graeme

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save Web based PDF files to Disk (VB 6)

    For Access 2000 and higher, you must do the following:
    - Open your database.
    - Select File | Get External Data | Import...
    - Navigate to and select InetTransferLib.mda, then click Import.
    - Activate the Modules tab, click Select All, then click OK.
    - You have now imported the modules from the Access 97 add-in into your own database.
    - Remove all instances of <code>InetTransferLib.</code> so that the line <code>Dim objFTP As InetTransferLib.FTP</code> becomes <code>Dim objFTP As FTP</code> etc.

    (There is an error in the text on the Access web, where it says "To use the classes, just refer to them with the 'InetTransferLib.' prefix" it should have been "To use the classes, just refer to them without the 'InetTransferLib.' prefix".)

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save Web based PDF files to Disk (VB 6)

    I have had some success with MSINET.OCX in VB6 but haven't tried it with binary file transfer. Not surprisingly, since it's not .NET, relevant information on the web seems to have been largely erased from existence. BTW, post a reference if you find one, for future prosperity.

    Alan

  8. #8
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Save Web based PDF files to Disk (VB 6)

    Hans,

    That Worked Some fiddling to allow for bad URLs. IE On Error Resume Next in the Loop. But susesefull download of the 10,000 pdf documents we needed

    Happy New Year to all Loungers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •