B
bradsalmon
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
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