HTML doc - Mail merge help

Associate
Joined
20 Oct 2005
Posts
112
Hi, I'm looking to distribute a HTML document to several hundred people and I want to customise it with personal name, email, tel numbers etc.

I've never used it before but some googling shows that mail merge is what I need but what I can't seem to find out is if it's possible to hide a larger field if info on a smaller field isn't present. i.e if they don't have a direct dial telephone number then it hides the paragraph with that field in it.

Can anyone steer me on the direction to go with this?

Ta

Mike
 
You might be able to do that with Word, using some macro scripting or something, but I would approach it with php. Read the data in and generate the document. Literally you could use if (!isset $phonenumber) { do nothing} else {echo paragraph} and so on. Get it to store the entire html back out to file or in a database for later retrieval.
 
Thanks for the reply. I eventually used OpenOffice to set up my fields linked to the spreadsheet. Then I inserted a 'section' over the area I wanted to hide with a rule of if a particular cell was blank. Seems to work out okay :)

Interested in knowing more about using php though. Is it relatively easy to pick up some basics for other times I might need to do this?
 
it's just a scripting language. you could use any (even DOS batch) , but i have been learning php for the last few months so I'd pick that. It's well suited to HTML generation.

Essentially you'd have your list of data in some kind of array or db and just loop through the data printing out each peice of info and associated data (or not as the case may be)
 
Back
Top Bottom