View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
StargateFan[_2_] StargateFan[_2_] is offline
external usenet poster
 
Posts: 12
Default Name of featu when field is empty, rest of info "slides" ...

On Thu, 28 May 2009 18:35:24 -0500, StargateFan
wrote:

On Fri, 29 May 2009 07:48:36 +1000, "Doug Robbins - Word MVP"
wrote:

This can be controlled in Word by the use of an If...then...Else field that
tests for the existence of data in a field that may be blank and either
inserts the contents if there are any, or moves on to the next field if
there are not. If there are contents in the field, the result for that
condition will also need to include a space or a carriage return as
appropriate for the context.

For example, if you have fname, initial and lname fields and there may or
may not be contents in the initial field, you would use

{ MERGEFIELD fname } { IF { MERGEFIELD initial } "" "{ MERGEFIELD
initial } { MERGEFIELD lname }" "{ MERGEFIELD lname }" }

If you had address1, address2, city fields and you did not want a blank line
if address2 was empty, you would use

{ MERGEFIELD address1}
{ IF { MERGEFIELD address2 } "" "{ MERGEFIELD address 2 }¶
{ MERGEFIELD city }" "{ MERGEFIELD city }" }

In the above, where the ¶ appears, you would need to press the Enter key (or
Shift + Enter)

In all cases, the { } must be inserted using Ctrl+F9. It will NOT work if
they are entered using the keys for those symbols on the keyboard. You use
Alt + F9 to toggle the display of the field codes.

--
Hope this helps.


Thank you! I believe it will. I'll take the information to work
tomorrow and we'll give it a try.


[snip]

Well, I've been trying since my post above to get this to work but
have had no real luck.

Fortunately, late Friday afternoon I was able to get permission to
combine the fields so that we wouldn't have to fiddle with 2 fields.
Despite this, I've tried to figure this out anyway. It seems to me
that we're concatenating fields here somehow, but since commas and
spaces and codes are so easy to put in the wrong place, thought I'd
figure this out ... it's very obvious that I must be doing something
wrong.

To make life easier, can we refer to the fields in simpler terms (...
and is the merge code displayed below exact, i.e., no word wrap
issues?):

{ MERGEFIELD A}
{ IF { MERGEFIELD B } "" "{ MERGEFIELD B }¶
{ MERGEFIELD C }" "{ MERGEFIELD C }" }

["A" below = Field 1 (in reality, Address field)
"B" below = Field 2 (in reality, originally Building_eng field)
"C" below = Field 3 (in reality, originallly Floor_eng field) ]


Do I have the merge codes okay? The above, when I translated it into
the field names in our spreadsheet, didn't work. Also, adding the
code for the special Shift+Enter, ¶ ("soft return"??), did the
opposite to what was intended since it _added_ an extra line each and
every time so that each label had blank lines in the final merge
whereas I only got a couple of rogue ones before.

Lastly, once I figured out we might be trying to concatenate, I
googled the archives with that new term. One piece of advice that
seems to be common is to set up an extra column, concatenate the terms
in Excel there, instead of Word, and to use that special field in the
merge instead. I hope people don't mind but this solution doesn't
work for me. My colleagues are confused enough as it is with the
sheet as it stands g. I'd like to figure out the IF statement
method instead since I believe it'll be easier for everyone. Thanks
for the group's indulgence. D