#1
|
|||
|
|||
Mail merge: remove empty rows when a field is not showed
Hello everybody.
I have a problem with the creation of a list with mail merge. I have to translate an archival inventory from excel to word. The colums of my table can be divided into two kinds: the ones that are always needed, and the optional ones. Also I need to put a label before certain fields. For exemple: ID, title, year, collocation are present in every record. Content, notes are present only when needed. _______ I created the template with mail merge using the IF function, so that when the optional fields are not empty it is showed "Label: blah blah blah", and when said fields are empty nothing is showed (not even the label). My problem is that when a field is empty, it remains an empty row I would like to remove. Here an example: ID: 1 Title: Human resources Content: personal dossiers of the employees. Note: Reserved informations. Year: 2000 ID: 2 Title: Paid bills [HERE I FIND AN EMPTY ROW] [HERE I FIND AN EMPTY ROW] Year: 2001 I would like my second record to appear: ID: 2 Title: Paid bills Year: 2001 _______ I attach some file so you can better understand the problem. Thanks a lot! |
#2
|
||||
|
||||
Instead of:
{ IF { MERGEFIELD Titolo }<> "" "{ MERGEFIELD Titolo }" "" }¶ use: {MERGEFIELD Titolo \f "¶ "} where ¶ is the actual paragraph break. Do the same with { MERGEFIELD Contenuto } Similarly, instead of: { IF { MERGEFIELD Note_alla_datazione }<> "" "Note alla datazione: { MERGEFIELD Note_alla_datazione }" "" }¶ use: { IF { MERGEFIELD Note_alla_datazione }<> "" "Note alla datazione: { MERGEFIELD Note_alla_datazione }¶ "} This is all discussed in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Quote:
I tried to follow what you wrote and also read the tips&tricks topic, but I cant' obtain what I need: things remain the same, or worse, I create one more break line. I think my problem is I need to use labels (which have to disappear when the field is ampty) and IF rules all toghether. Can you explain better what I have to do or even better give me the correct version of my template? Thanks so much! |
#4
|
||||
|
||||
If you need to skip entire labels, you should apply a mailmerge filter with the required criteria, which you do via Mailings|Edit Recipient List>Filter.
As for the field coding I described, see the attached.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Quote:
Thanks, thanks, thanks! The solution was quite obvious, after all... I was doing wrong because I was leaving the line break after the fields instead of deleting it and writing them right after the previous. So I was writing: {IF{MERGEFIELD Titolo}<> "" "{MERGEFIELD Titolo}¶ "}¶ {IF{MERGEFIELD Contenuto... Instead f: {IF{MERGEFIELD Titolo}<> "" "{MERGEFIELD Titolo}¶ "}{IF{MERGEFIELD Contenuto... No comment please. I just used the same trick also for the "Vecchia segnatura" and "Note alla vecchia segnatura", and everything was perfect. Thanks again! |
Tags |
if rule, mail merge |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
creating badges using mail merge and do not want to supress lines with empty fields | johnmorabito | Mail Merge | 1 | 04-25-2018 02:33 PM |
Delete All empty Rows - Print - Undo all Rows deleted | Bathroth | Word VBA | 1 | 10-01-2014 01:40 PM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |
Mail Merge Empty Data Field | Licos101 | Mail Merge | 2 | 04-10-2014 06:19 AM |
How to ignore a mail merge field if the field is blank | redzan | Mail Merge | 1 | 05-16-2013 08:34 AM |