Word - INCLUDEPICTURE path weirdness

J

josh

OK, experts, I got a Word picture challenge for you...

I'm trying to link images using fields
(insert/picture/file/insert as link) in a Word doc, and
encountering mysterious behavior. We are both using Word
v2002. I'm using v10.2627.2625 (ie, no service packs).
He's using the version that has service pack 3 installed.
He's also tried it with Word 2000, sp3.

Here's the field code for an image that my friends Word
2000 sp3 generates when he inserts a linked picture. It
works on his machine:
{ INCLUDEPICTURE "pictures\\image002.jpg" \*MERGEFORMAT
\d }

Double backslash?! That sould have no place in the
middle of a path, right?

This works on my machine, not my friends:

{INCLUDEPICTURE "pictures/image002.jpg" \*
MERGEFORMATINET \d }

However, the exact same text but different filename works
later in the doc for both his machine and mine!

{INCLUDEPICTURE "pictures/box.jpg" \* MERGEFORMATINET \d }

Please cc (e-mail address removed) on replies so I
know someone posted.

Thanks
-Josh
 
M

macropod

Hi Josh,

If you read Word's help file, you'll find that double backslashes in the
path are indeed correct, not only for INCLUDEPICTURE fields, but also for
INCLUDETEXT, HYPERLINK, LINK, & RD fields. That's because the backslash also
operates as a switch in fields (as in the \d), so '\\' tells Word that the
second '\' is a path separator.

Ordinarily, though, you would also have the full path, including the drive,
as part of the field, but your posted examples lack this.

As you've discovered, forward slashes also work. The difference seems to be
related to relative (/) vs absolute (\) paths. You'll find, for example,
that paths specified with '\\' are absolute even if incompletely specified -
try moving a document/linked object pair to another location and the link
will stop working.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top