Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Merge with letterheads

Status
Not open for further replies.

Maquis

Programmer
Jul 19, 2001
934
US
Hi there,

I'm really hoping someone can point me in the right direction here. I'm trying to create a Word merge document (Word 97) with a plain ASCII text data file. I have everything set up and the merge works perfectly.

Here's the kicker. I would like to also have the ability to have different letterheads on the top of the letter depending on the value in a certain field of the data file. I already have the appropiate graphics files for each letterhead. Is there some way to incorporate all of them into the Word template and perhaps just make the appropiate one visible? I've tried using the query options and the If..Then..Else merge options to accomplish this, but so far nothing's worked.
Maq [americanflag]
<insert witty signature here>
 
If you have to use the Ascii text file then this is a tricky problem.

You would have to run code to set the picture property to visible. I'm not sure this is possible. Also having all those pictures in each letter (although they are hidden) will make you document size BIGGER than I'd recommend.


Perhaps you could run code to import the ascii text into an Access table. In access you would have another table with one copy of each picture/letterhead and a unique key field for each different picture.

Then you set up a query to merge the 2 tables into one recordset. Finally do the mail merge linked to the query

This would give you your result.

Alternatively you could use Excel, but you would have to manually put the relevant picture in each cell (or set up some labourous if statements and include each picture for each record/row. This would be a huge xls size and incredibly redundant and in-eligant.

Good Luck
Zollo [smile]
 
Thanks for the reply. I was afraid this would be impossible within Word (without involving Access or Excel). I think the next step is to try and talk my users into turning it into an Access report. Maq [americanflag]
<insert witty signature here>
 
I'm not sure it's impossible, if I understand what you want, and if you can link the pictures in from a file. You need an if...then...else which links in the graphic according to a value of a variable:

{if { MERGEFIELD Title } = &quot;Mr&quot; {INCLUDEPICTURE &quot;C:\MAN.BMP&quot; \* MERGEFORMAT} {INCLUDEPICTURE &quot;C:\WOMAN.BMP&quot; \* MERGEFORMAT}}

Hope this helps

Ben
 
Thanks Beniez. I'll try the code and see what happens.

Sorry for ignoring you. My notification for this thread accidentally got unchecked so I never came back to it. I found it today because I was going through my past threads looking for something else. Maq [americanflag]
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top