Merging pictures along with data...

E

Evan Lapka

I'm currently working on a database of employees for my supervisor. I'm
making individual profiles of employees by using the mail-merge feature in
Microsoft word to take the data from the spreadsheet and filter it into word
documents. This part is going wonderfully... BUT, my supervisor told me today
that he wants ID pictures included with each profile. Is there a way for me
to insert a picture into a cell on the spreadsheet so that mail merge will
automatically sort the pictures to the correct files along with the rest of
the data? Any input would be greatly appreciated, thanks!
 
P

Peter Jamieson

Put the the full pathname of the ID picture in a cell in Excel (you may also
have to double up any backslashes in the name, or use single forward
slashes, e.g.

c:\\my id pictures\\xyz.jpg
or
c:/my id pictures/xyz.jpg

Let's suppose you put the filenames in a column called IDPicture.

Then use the following nested field in Word:

{ INCLUDEPICTURE "{ MERGEFIELD IDPicture }" \d }

(both pairs of {} have to be the special field codes you can insert using
ctrl-F9)

Alternatively, if all the pictures are in the same folder, say c:\my id
pictures, thenyou can put just the file name "xyz.jpg" in the IDPicture
column and use

{ INCLUDEPICTURE "c:\\my id pictures\\{ MERGEFIELD IDPicture }" \d }

(Make sure there are no spaces that shouldn't be there).

Then merge to a new document, ctrl-A to select it, and press F9 to update
the fields to see the different pictures.

Peter Jamieson
 
E

Evan Lapka

perhaps I'm not doing something right, but after I enter in
{ INCLUDEPICTURE "c:\\my id pictures\\{ MERGEFIELD IDPicture }" \d } with
the modified file parameters, etc... the text just disappears and no image is
present.
 
P

Peter Jamieson

While previewing the mail merge main document, use Alt-F9 to view the field
codes, then select { MERGEFIELD IDPicture }, right-click and select the
Toggle field code option. You should now see the complete file path name.
Apart from the doubled-up backslashes, is it /exactly/ the same as the
actual full path name of one of your images? (No extra spaces at the
beginning or end or around the file name, for example)

Peter Jamieson
 
E

Evan Lapka

It now reads "{ INCLUDEPICTURE "Pictures/%7b%20MERGEFIELD%20IDPicture%20%7d"
\* MERGEFORMAT \d }" which is not what I initially entered.
 
P

Peter Jamieson

OK,

1. you also need to uncheck Word Tools|Options|General|Web
options|Files|"Update links on save" and try again.(Even though what you are
doing has nothing to do with the Web)

2. You need to ensure that the { MERGEFIELD IDPciture } is a /field/ - use
ctrl-F9 to insert the special field code braces - typing them from the
keyboard doesn't work.


Peter Jamieson
 
E

Evan Lapka

Alrighty, I did what you said for number 1, and now the text is actually
appearing where it should, my only issue now is that instead of the picture
appearing in the space, only the file name is appearing.
 
P

Peter Jamieson

OK, so when you Alt-F9 to display the "field results" you see something like

c:\\my id pictures\\mypicture.jpg

Or what?

You are welcome to despam my e-mail address (remove "KillmapS") and send me
copies of your document !

Peter Jamieson
 
E

Evan Lapka

the word document has this in the space: { MERGEFIELD IDPicture}
And in the corresponding excel cell: 265332.jpg
 
P

Peter Jamieson

From what you say, I can only make guesses. I think you have not constructed
the fields the way that they need to be. Let's start with three ideas:
1. this works for lots of people but...
2. it is not yet working for you so...
3. the problem is likely to be something really simple

Let's try to go step-by-step...

<<
the word document has this in the space: { MERGEFIELD IDPicture}

Let's start with your field:
a. in Word, you see { MERGEFIELD IDPicture }
b. what do you see if you press Alt-F9? Do you see: "265332.jpg" ? (But
without the double-quote marks?)

Which folder contains the file

265332.jpg

?

Peter Jamieson
 
E

Evan Lapka

when ALT-F9 is pressed, { MERGEFIELD IDPicture } appears, when ALT-F9 is
pressed again, 265332.jpg" (without the quotation marks) appears along with
the other desired information in other fields i.e. Name, Address, etc...

{ MERGEFIELD IDPicture } is set up as a field.
 
E

Evan Lapka

the picture is located in:
d:\\Documents and Settings\\LAPKAEM\\My Documents\\CDD Students\\Pictures\\
 
P

Peter Jamieson

Then are you using

{ INCLUDEPICTURE "d:\\Documents and Settings\\LAPKAEM\\My Documents\\CDD
Students\\Pictures\\{ MERGEFIELD IDPicture }" }

?

Peter Jamieson
 

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