Solved

Word document file is not opening the hyperlink pictures?

Posted on 2014-11-05
4
329 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now