![]() |
#1
|
|||
|
|||
![]()
My user is working on a mail merge document but isn't using the address block feature, instead has inserted field codes seperately. They are:
«Prefix» «Firstname» «Lastname» «Organisation» «Address1» «Address2» «Address3» «Address4» «City» «County» «Postalcode» We have 5 fields that are occasionally blank in the data form, but instead of supressing the lines it's leaving a blank space instead. I know there is a merge code you can write using the "if" rule, but I'm really bad at coding the merge codes and field codes. What code would I need to insert for word to suppress the lines of the following 5 field codes? Address 3, Address 4, Organization, County and Country. |
#2
|
||||
|
||||
![]()
Hi Welshie82,
There are two mergefield switches you can use for this: \b - Specifies the text to be inserted before the MERGEFIELD field if the field is not blank. \f - Specifies the text to be inserted following the MERGEFIELD field if the field is not blank. For example, suppose your mergefield is «Data». Selecting the field and pressing Shift F9 will reveal: {MERGEFIELD Data} If you code the mergefield as: {MERGEFIELD Data \b "¶ "} (where ¶ is a pargraph break) it will insert a paragraph break before the mergefield if the field is not blank. Conversely, if you code the mergefield as: {MERGEFIELD Data \f "¶ "} it will insert the paragraph break after the mergefield if the field is not blank. So, instead of having: «Prefix» «Firstname» «Lastname» «Organisation» «Address1» «Address2» «Address3» «Address4» «City» «County» «Postalcode» «Country» you might add the \b switch to the «Organisation», «Address2», «Address3», «Address4», «County» & «Country» fields and lay them out as: «Prefix» «Firstname» «Lastname»«Organisation» «Address1»«Address2»«Address3»«Address4» «City»«County» «Postalcode»«Country»
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Wonderful, thank you Macropod.
|
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Ephasa | Word | 9 | 04-30-2020 02:09 PM |
![]() |
AlteDäne | Mail Merge | 5 | 06-29-2011 05:32 PM |
Urgent help needed with removing blank lines... | iammom2four | Outlook | 0 | 12-15-2010 06:12 AM |
![]() |
sieler | Word | 3 | 04-12-2009 01:38 PM |
Unable to print blank lines on a legal form | dpenbag | Word | 0 | 03-20-2006 09:13 PM |