Solved

Word document file is not opening the hyperlink pictures?

Posted on 2014-11-05
4
341 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 35

Accepted Solution

by:
Kimputer earned 500 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 35

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

808 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