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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge variable table length 1

Status
Not open for further replies.

DrSimon

IS-IT--Management
Dec 14, 2001
674
GB
I am doing a mail merge from a delimited text file into a table. My problem is that the text file is downloaded from another system and sometimes the text file contains say 10 records and other times it may be more than a hundred. I need the table to 'fit' the number of records so that I don't have to create a template with hundreds of rows when only 10 will be used. I suppose what I really want to do is invoke that part of the label wizard that fills in all the entries for you. Is there any easy way of doing that or will I have to use VBA?
Simon Rouse
 
You dont't say what what you are using but I assume Word (could be crystal but hey) but don't know which version.
Anyway, in Word 2000 there is an option of "Don't print Blank Lines When Data Fields Are Empty" when you commit to merge.
If you check this button then if you have 100 rows one day and only 10 the next the saem template will only print out what it can find!

Regards, Phil.

Full Member of Shareholders United.
Show your true support here:
"M.U.F.C. Not for sale to Glazer"
 
Hi DrSimon,

Really need a bit more information. How exactly do you want the data in your table? Mail merging to labels is easy enough to set up but will put each record in a single table cell and preformat each page. Is that anything like what you want?

A better idea is probably to open your text file in Word and convert Text to Table, or go via Excel.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
Maybe your Main Document should have been created using the "catalog" option. (Tools > Mail Merge > Create > Catalog...) Then you only have to set up one record using your mergefields, but when merged with your data document, the mergefields would repeat for the exact number of records in your data document.

 
Thanks very much to both of you for replying so quickly. Phil - I'm actually using Word 2002 (I forgot how wide this forum could be). You're option sounds very interesting, but I haven't seen it - when should it appear?
Simon Rouse
 
When you select Tools, Mailmerge, you are presented with 3 options

Main Document
Data Source (should be greyed out)
Merge the data with the document(should be greyed out)

Once you have assigned the data and set the format the last one should now be selectable, once you have selected this Merge the data option you will get another screen.
On this screen is where the "Don't print Blank Lines When Data Fields Are Empty" lives, hope this helps.





Regards, Phil.

Full Member of Shareholders United.
Show your true support here:
"M.U.F.C. Not for sale to Glazer"
 
All good suggestions. Firstly there's something odd about 2002 because under Tools all I have is Letters and Mailings with the options of MailMerge Wizard, Show MailMerge Toolbar, Envelops and Labels, Letter Wizard.

I followed dcompto's suggestion and used document type directory. To be be fair this did what I said I wanted but I didn't add that I need to have header information at the top of the document. I can't put that in the body of the document as its get replicated for each record, so I've set up the page header to hold the info. It's messier than I thought but I got there in the end.
Thanks to all of you, but dcomto gets my star for pointing me in the right direction.
Simon Rouse
 
Hi, DrSimon,

Regarding your statement:
...there's something odd about 2002 because under Tools all I have is Letters and Mailings with the options of MailMerge Wizard, Show MailMerge Toolbar, Envelops and Labels, Letter Wizard.
I should have told you that I have Office 2000 and the menu options may differ. I apologize for this omission.
 
Not a problem - thanks again to all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top