View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Import or merge DWG / Picture files into a document

Insert the file manually but select the "Insert and Link" option on the
drop-down at the right hand side of the Insert button. Then use Alt-F9 to
look at the INCLUDEPICTURE field that Word inserted. There will probably be
a "\c switch" near the end that specifies the converter name for dwg files.
Let's assume it says "\c dwg" for example.

One way to merge the files is to create a data source (for example a table
in another Word document) where one of the columns contains the file name of
the image file. Each row should list one of the files. Generally speaking
it's a good idea to have more than one column in a data source as Word can
sometimes get stuff wrong if you don't.

So suppose you have a column x that just contains something to keep Word
happy, and a column picfile that contains the name of your file. e.g.

x,picfile
1,mypic1.dwg
1,mypic2.dwg
1,mypic3.dwg


OK, so this isn't automatically picking the file names from your directory,
but maybe you can do that step later if you really need it.

Then use either the mail merge wizard or the mail merge toolbar (Word
Tools|Customize) to create a new mail merge main document and attach the
data source you just created.

As far as the layout is concerned,
a. Table|Insert table, select 2x3, select Fixed column width and specify
the column width.
b. Select the table. In Table|Table|Properties...|Row| specify the row
height you want and select the "Exactly" setting.

You should then have a layout that pictures will fit into, with any
necessary scaling. If I'm wrong about that you won't get much further with
that bunch of settings...

Then in cell one of your table, insert the following nested field using the
converter name you noted above. Use ctrl-F9 to insert each pair of {} and
type everything else. Let's suppose your pictures are in c:\mypictures.

{ INCLUDEPICTURE "c:\\mypictures\\{ MERGEFIELD picfile }" \c dwg }

Make sure there are no spaces in the file name that should not be there.
Then select the fields, edit|copy to cell 2. In cell 2, insert another
field, { NEXT } before the { INCLUDEPICTURE } field. Then select the two
fields, edit|copy and paste to all the other cells.

(you may well be able to do all the above by setting up a "label merge",
defining a custom layout, inserting the content of cell 1 as suggested, then
"propagating the fields" to the other cells).

Then merge to a new document. You will probably see a document where all the
pictures look the same. Select the new document (e.g. using ctrl-A) and
press F9 to re-execute all the fields. With any luck you should see a
different picture in each table cell.

Try that for starters and see how far you get.

Peter Jamieson


"Rookie_User" wrote in message
...
I have a folder full of dwg files (AutoCAD files). You can insert the file
manually so I know it accepts the format. However, my goal is to create a
page with six squares (a table 2x3) and insert a picture in each square
and
then it will repeat as it processes through all the files in the
designated
folder. If possible it would be nice that the filename gets posted
somewhere
for identification purposes. Does this make sense, can anyone help?

I have started to research on the board how to do this but haven't found a
solution to get me there yet.