My Technical Notes

Wednesday, 18 March 2015

MS Word 2010 - Inserting image with relative path

To insert an image with a relative path, we first use `Ctrl+F9` to insert field code brackets. Within the brackets, we want the following code:

INCLUDEPICTURE "..\\Path\\to\\image.png" \d \* MERGEFORMAT 

Note that if you are using a back-slash in the path, you will need to double them up, to escape them.

Alternatively, you can use forward slashes instead, which do not need escaping:

INCLUDEPICTURE "../Path/to/image.png" \d \* MERGEFORMAT 

In MS Word, fields don't automatically update, therefore you will need to press `F9` while caret is inside it.

`Alt+F9` toggles field codes in the document.

No comments: