View Single Post
 
Old 01-29-2016, 12:38 AM
PRA007's Avatar
PRA007 PRA007 is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default Extract embedded images and save according to hyperlink.

I have document containing embedded images.
I want to extract it and name it according to underlying hyperlink.

My embedded images are recognized by (modified) code from https://www.msofficeforums.com/word-...mages-web.html

I inserted two lines not supported by word.
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim iShp As InlineShape
For Each iShp In ActiveDocument.InlineShapes
  With iShp.Range
    If .Hyperlinks.Count = 1 Then
    MsgBox .Hyperlinks(1).Address
      iShp.Export "D:\" & .Hyperlinks(1).Address & ".png" 'I think not possible.
      'or
      iShp.changenamge ".Hyperlinks(1).Address" 'Don't know about it.
    End If
  End With
Next
Application.ScreenUpdating = True
End Sub

Is there any way I can export the embedded images as it's hyperlinked name. I know that I can extract it using html or .zip method but it gives image named as "image001.png" format. Is there any way I can do this?

Quote:
iShp.changenamge ".Hyperlinks(1).Address" 'Don't know about it.
I mean if this eventually change the image name so that while extracting using zip or something It can give the desired result.
Reply With Quote