Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Word document file is not opening the hyperlink pictures?

Posted on 2014-11-05
4
Medium Priority
?
372 Views
Last Modified: 2014-11-05
I has a word document 420 pages, 14,267 word, 32 MB. and they have 44 folders of pictures.
I have copied both the Word document and the folders of images to flash drives and my Seagate backup drive. The problem is that the Word document and the images will only open on my computer. On other computers, only the Word document pulls up with no linked pictures.  Therefore, I can only print the entire project (420 pages) from my own computer.  I assume this is because the images were linked from their original source on my computer, rather than imbedded in the document.
Are there other hidden control file I need to copy?
0
Comment
Question by:glaurin
  • 2
4 Comments
 
LVL 36

Accepted Solution

by:
Kimputer earned 2000 total points
ID: 40423610
Your images are probably hard linked (for example: C:\Users\xxx\My Pictures\xxx.png)
After copying your files away, it's still looking at this very fixed location.
The problem wouldn't exist if it was stored as a relative link, but you have no control over that. So here's how to fix it (using relative location, the docx file has to be in the same location as the picture files).
First make sure you're saving in the docx file extension (you might need to install the fileformatconverter of Office Compatibility Pack if you haven't already).
After successfully saving it, rename the file from doc1.docx to doc1.zip
Now open the zip (preferable in 7-zip), and locate the file document.xml.rels in the folder word\_rels.
Now press F4 to edit the file. Since you have a lot of pictures, you will probably recognise the hard link. Use Find & Replace ALL to change it, so that it ends up as ..\picture.png (i.e. replace "C:\users\xxx\" with "..\")
Save the file, update the zip, then rename back to .docx
Open the word file and your pictures are there again. Everytime you copy it somewhere else, if you keep the docx file together with the pics in one folder, you will be able to see the pictures.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 40423737
You could try running a VBA macro like this:
Sub Unlink()
Dim sh As Shape
Dim ilsh As InlineShape
For Each sh In ActiveDocument.Shapes
    With sh
        If .Type = msoLinkedPicture Then
            .LinkFormat.Update
            If Not .LinkFormat Is Nothing Then 'update may break the link anyway
                .LinkFormat.BreakLink
            End If
        End If
    End With
Next sh
For Each ilsh In ActiveDocument.InlineShapes
    With ilsh
        If .Type = wdInlineShapeLinkedPicture Then
            .LinkFormat.Update
            If Not .LinkFormat Is Nothing Then 'update may break the link anyway
                .LinkFormat.BreakLink
            End If
        End If
    End With
Next ilsh

End Sub

Open in new window

0
 
LVL 36

Expert Comment

by:Kimputer
ID: 40423836
My original post was wrong with the ..\, it should have been .\

But @GrahamSkan's post brought me to this:

Sub Relativelink()

Dim ilsh As InlineShape
For Each ilsh In ActiveDocument.InlineShapes
    With ilsh
        If .Type = wdInlineShapeLinkedPicture Then
            .LinkFormat.SourceFullName = ".\" + Split(.LinkFormat.SourceFullName, "\")(UBound(Split(.LinkFormat.SourceFullName, "\")))
        End If
    End With
Next ilsh

End Sub

Open in new window


(might need to be updated to the Shapes code instead of InlineShape)
I.e. this solution is only useful if you move the doc and pictures to one folder (no subfolders involved).
0
 

Author Closing Comment

by:glaurin
ID: 40424213
Thank you for this solution, once I open to edit the .xml.rels file it gave me the picture path that happen to be in several location on the hard drive.

Thank You
Gerry
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question