# Weird problem using relative path to link picture in Word



## JamesBarwell (Nov 7, 2006)

Hi all,

I've spent the last few days tearing my hair out over some Word documents. I'm trying to link a picture into my Word templates and need to use a relative path to do it, as the folder where the documents reside won't always be the same. The basic setup is as follows:

C:\homeview\Branch1\Templates\

My .dot templates sit within the Templates folder. My image, "head.wmf", sits in Branch1. The number of the Branch folder will change, hence why I need a relative path.

My link originally looked like this, which should tell it simply to look up a directory and find the file:

{ INCLUDEPICTURE ../head.wmf \d \* MERGEFORMAT }

This does work when I open the template, but when opening an instance of the template (i.e. double-clicking, creating a new doc from it) it can't find the picture and displays a red X. I thought this was because the new instance wasn't being created in the same place, however I can see the temporary file is created within the same Templates folder (alongside the .dot), so I have no idea why that fails to pick up the picture.


Experimenting, I found that the new instance picks up the picture if I set the path like this:

{ INCLUDEPICTURE ../../../homeview/Branch1/head.wmf \d \* MERGEFORMAT }

but not if I do this:

{ INCLUDEPICTURE ../../Branch1/head.wmf \d \* MERGEFORMAT }


This is completely baffling me - it seems that the path must go back up to the root then jump back in for it to work, is this a bug in Word or can anyone offer another explanation? I really need to avoid mentioning the Branch folder at all in my link so that I can just use one set of templates for all Branches.

Just to note: I've turned off "update links on save", and "save picture in document". When I change the path I select the image and press F9 to make sure it is updating. I've also applied the registry fix to turn off case sensitive hyperlinks.

If anyone has any idea what's going on I will be very grateful, cheers.


----------

