Re: Downloading web pages
- From: "Dr. Stephan Kassanke" <kassanke.news@xxxxxx>
- Date: Sat, 29 Apr 2006 10:15:57 +0200
"bradsalmon" <bradsalmon@xxxxxxxxx> schrieb im Newsbeitrag news:1146167588.998519.210660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,
I've got to the head scratching stage after battling with this all day
so thought I'd ask for some advice/tips.
The basic idea is that I have an Access 2002 database which I'd like to
be able to download web pages from. I don't need to see them, just
simply save the page to a folder. For info, I'm running XP Pro and IE6
SP1.
I started looking into the references for Microsoft HTML object library
and Internet Controls but couldn't get these to work. There was also
some reference to Inet that I came across but I think my activex
limitations stopped this from working. Hence I thought I'd go back to
the old skool approach and simply open the pages in Word (2002) and
then save the files.
This works fine if I do it manually but the problem I've now got is
that my web access requires a password, hence manually I can type it in
and all works well, but the code just produces errors when it tries to
open the weblink. I thought I could work around this by using the same
instance of Word that I've already entered the password for, but no
matter what I try the code always insists on treating Word as if it's a
new instance. Here's where I've got to -
Public Function get_webpg(url As String) As Boolean
On Error GoTo Err
Dim objWord As Object
get_webpg= False
Set objWord = Word.Application
'objWord.Application.Visible = True
objWord.Documents.Open url
objWord.SaveAs C:\tester1
objWord.Close
get_webpg = True
Exit Function
Any thoughts, tips or advice would be greatly appreciated as the only
way around this I have at present is to create a web page with
hyperlinks and manually click 'Save target As' on each of them (Not a
very nice thought).
TIA,
Brad
Dear Brad,
take a look at wget (http://www.gnu.org/software/wget/). This is a somehow different approach, as wget does not integrate very good in the VBA world (you have to use a shell). But it is fast, reliable and does exactyl what you want.
Might be woth a look.
Stephan
.
- References:
- Downloading web pages
- From: bradsalmon
- Downloading web pages
- Prev by Date: Concurrent Acess into MS Access
- Next by Date: Re: How to get the path of the Window Desktop folder?
- Previous by thread: Downloading web pages
- Next by thread: Re: HOw to count number of lines in a HEADER?
- Index(es):