Maverick Level: Trainee
 Registered: 05-10-2006 Posts: 3
|
Right Click Save As... using IE
Someone e-mailed me about 24 word documents which contain hyperlinks. Basically they are thumbnail images with embedded hyperlinks. Of course when you click on it, it takes you to a website where you can view the full image. Approx. 20 hyperlinks per document. 20 links x 24 docs = 480 images. So needless to say it's going to be extremely tedious to do it manually.
Luckily I was able to get some help writing a VBA routine that automatically clicks on each link within a single document, so I am half way there. (VBA was not done by me).
Sub FollowHyperlink()
'
' FollowHyperlink Macro
' Macro created 10/4/2006 by Gerry
'
With ActiveDocument
Selection.Delete Unit:=wdCharacter, Count:=1
Dim oHyperlink As Hyperlink
For Each oHyperlink In ActiveDocument.Hyperlinks
oHyperlink.Follow NewWindow:=False, AddHistory:=True
Next
End With
End Sub
|
What I want is to save the image that loads up in the browser. Although Firefox is my primary browser, IE is set to default. Since there are typically many images on a website, I suppose you're going to ask how will the VB code know which image to save? Luckily all the images start with the following URL:
http://www.myurl.com/image.php?id=xxxxxxxxxx
The only thing that changes is the last 9 digits as indicated by the Xs.
Once the hyperlink is activated, it loads each image in Internet Explorer. Right now, I am manually right clicking on each photograph and doing a Save Picture As...
What I trying to do is automate this step. My first thought is to somehow have my VBA routine integrated wiht a few lines of VB code. For example get VB to look for A: a specific string on the site, and B: save the image into a predefined folder where I have all my photos saved.
The 2nd option I thought would be to open up my TIF (temp internet folder) and then copy all the images in there to another folder where my photo collections are.
Of course since i'm such a newbie, I have no idea if this is possible and if so, how to do it. What is the best approach? I'm confused.
I'm using Word 2003 and IE 6.0.
[Edited by Maverick on 06-10-2006 at 10:15 AM GMT]
[Edited by Maverick on 06-10-2006 at 10:24 AM GMT]
|