Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] StargateFanNotAtHome@mailinator.com is offline
external usenet poster
 
Posts: 3
Default Name of featu when field is empty, rest of info "slides" ...

.... up or to the left so that there are no blank spaces.

In Filemaker Pro (FMP), if memory serves, this is called "slide" or
"sliding". What would the term be in Word 2007, pls? I need to find
out how to code for blank data. There must be a way to emulate this
in a word processing doct., vs. a database such as FMP.

Thanks!

D
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Name of featu when field is empty, rest of info "slides"...

Word 2007 should remove blank lines by default /when there is nothing
except MERGEFIELD fields on them/. But there are circumstances in which
that does not actually happen, so it is probably better to use IF
fields, e.g.

a{ IF "{ MERGEFIELD myfield }" = "" ""
"{ MERGEFIELD myfield }
" }z

will output

az

if myfield is blank and

amydata
z

if myfield is "mydata"

All the pairs of {} need to be the special field code braces that you
can enter using ctrl-F9

Peter Jamieson

http://tips.pjmsn.me.uk

wrote:
... up or to the left so that there are no blank spaces.

In Filemaker Pro (FMP), if memory serves, this is called "slide" or
"sliding". What would the term be in Word 2007, pls? I need to find
out how to code for blank data. There must be a way to emulate this
in a word processing doct., vs. a database such as FMP.

Thanks!

D

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Name of featu when field is empty, rest of info "slides" ...

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.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
wrote in message
...
... up or to the left so that there are no blank spaces.

In Filemaker Pro (FMP), if memory serves, this is called "slide" or
"sliding". What would the term be in Word 2007, pls? I need to find
out how to code for blank data. There must be a way to emulate this
in a word processing doct., vs. a database such as FMP.

Thanks!

D


  #4   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 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.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
wrote in message
...
... up or to the left so that there are no blank spaces.

In Filemaker Pro (FMP), if memory serves, this is called "slide" or
"sliding". What would the term be in Word 2007, pls? I need to find
out how to code for blank data. There must be a way to emulate this
in a word processing doct., vs. a database such as FMP.

Thanks!

D


  #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



  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Name of featu when field is empty, rest of info "slides" ...

The fields look OK. You may however need to update the fields (Ctrl+A then
F9) to get the desired result. If merging directly to the Printer, make
sure that the Update Fields before Printing option is checked under Printing
Options.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"StargateFan" wrote in message
...
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


  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Name of featu when field is empty, rest of info "slides"...


{ 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) ]


Let's step through all the blank/non-blank possibilities for A, B and C,
e.g. suppose you have simple data like this, where blank means the
field is blank/empty

A B C
blank blank blank
blank blank C2
blank B3 blank
blank B4 C4
A5 blank blank
A6 blank A6
A7 B7 blank
A8 B8 C8

Let's then imagine you have a Letter-type mail merge main document like
this:

Top
A: { MERGEFIELD A }
B: { MERGEFIELD B }
C: { MERGEFIELD C }
{ MERGEFIELD A }
{ IF { MERGEFIELD B } "" "{ MERGEFIELD B }¶
{ MERGEFIELD C }" "{ MERGEFIELD C }" }
Bottom


(where Top, A:, B:, C:, Bottom all start new paragraphs and the other
fields are laid out as you have them).

By default, Word should
a. never suppress the lines starting Top, A:, B:, C: Bottom
b. suppress the line/paragraph { MERGEFIELD A } when A is blank
c. always output at least one paragraph between the { MERGEFIELD A }
line and the "Bottom" line (because whatever the values of B and C,
there is a paragraph mark after the end of the IF field
d. output one additional paragraph in the case where B is not blank

In Word 2003 and previously, Word would suppress the { MERGEFIELD A }
line completely even during merge preview. In Word 2007, Microsoft have
defty tossed in yet another barrier to successful mailmerge because when
A is blank, the line is not suppressed in preview, but a funny little
mark like a greyed-out double quote appears instead (with no visible
paragraph mark). This is more obvious if the paragraphs are (say)
double-spaced, and could have interfered with your investigation of this
problem. I have a feeling it might have something to do with the
spelling checker. However, this mark does not appear when you merge to a
new document or to the printer. When you do that, you should get:

---------------------------------------------------

Top
A:
B:
c:

Bottom
New page
Top
A:
B:
c: c2
c2
Bottom
New page
Top
A:
B: b3
c:
b3

Bottom
New page
Top
A:
B: b4
c: c4
b4
c4
Bottom
New page
Top
A: a5
B:
c:
a5

Bottom
New page
Top
A: a6
B:
c: c6
a6
c6
Bottom
New page
Top
A: a7
B: b7
c:
a7
b7

Bottom
New page
Top
A: a8
B: b8
c: c8
a8
b8
c8
Bottom

---------------------------------------------------

(without the
---------------------------------------------------
!)

That is in fact what I get, both in Word 2003 and Word 2007.

Just to be sure, if I copy the content of my mail merge main document,
convert that document into a label merge main document, paste the
content into label one, remove any additional paragraph marks at the
bottom of the cell, propagate labels and merge, I get the same layouts
in each case.

The questions/points now a
a. are the outputs above the ones you expected from the field codes
you have? If not, then I'd say there's probably a misunderstanding about
what the field codes you have should do. For example, if you /also/ want
to suppress the C field when it is blank, you will need additional "IF
field coding".
b. if you actually go through the above steps, do you have different
results? If so, then either
- they are different because there are still ambiguities in the way
I have set up the document (i.e. where are the paragraph marks). We can
sort that out if necessary, or
- they really are different, in which case maybe you can point out
where the differences occur
c. if however, the expected results and the actual results all match
with mine, but you are still getting unexpected results with a simple
example such as the above but with /real data/, then maybe there is
something in your data that the above does not take account of
d. if the results are the same and everything works with /real data/
as well, then perhaps your field setup is much more complicated and we
need to look there for an answer. For example,
- field suppression simply does not work the same way when fields
are nested inside other fields such as IF, INCLUDETEXT etc.
- in the unlikely event that you also have bookmarks in your mail
merge main document, and the value of B could equal the name of one of
those bookmarks, and the bookmark result was blank, you would need to
put quotes around the { MERGFIELD B } test in the IF field, i.e.

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

rather than

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

(If you add a field like

{ SET b3 "" }

at the beginning of the test mail merge main document, update it, then
perform the merge, you will probably see what I mean.

If necessary I'll post these sample files on the web somewhere but I
won't be able to do that for a couple of days.

Peter Jamieson

http://tips.pjmsn.me.uk

StargateFan wrote:
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

  #8   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 Mon, 01 Jun 2009 09:22:49 +0100, Peter Jamieson
wrote:


{ 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) ]


Let's step through all the blank/non-blank possibilities for A, B and C,
e.g. suppose you have simple data like this, where blank means the
field is blank/empty

A B C
blank blank blank
blank blank C2
blank B3 blank
blank B4 C4
A5 blank blank
A6 blank A6
A7 B7 blank
A8 B8 C8

Let's then imagine you have a Letter-type mail merge main document like
this:

Top
A: { MERGEFIELD A }
B: { MERGEFIELD B }
C: { MERGEFIELD C }
{ MERGEFIELD A }
{ IF { MERGEFIELD B } "" "{ MERGEFIELD B }¶
{ MERGEFIELD C }" "{ MERGEFIELD C }" }
Bottom


(where Top, A:, B:, C:, Bottom all start new paragraphs and the other
fields are laid out as you have them).

By default, Word should
a. never suppress the lines starting Top, A:, B:, C: Bottom
b. suppress the line/paragraph { MERGEFIELD A } when A is blank
c. always output at least one paragraph between the { MERGEFIELD A }
line and the "Bottom" line (because whatever the values of B and C,
there is a paragraph mark after the end of the IF field
d. output one additional paragraph in the case where B is not blank

In Word 2003 and previously, Word would suppress the { MERGEFIELD A }
line completely even during merge preview. In Word 2007, Microsoft have
defty tossed in yet another barrier to successful mailmerge because when
A is blank, the line is not suppressed in preview, but a funny little
mark like a greyed-out double quote appears instead (with no visible
paragraph mark). This is more obvious if the paragraphs are (say)
double-spaced, and could have interfered with your investigation of this
problem. I have a feeling it might have something to do with the
spelling checker. However, this mark does not appear when you merge to a
new document or to the printer. When you do that, you should get:

---------------------------------------------------

Top
A:
B:
c:

Bottom
New page
Top
A:
B:
c: c2
c2
Bottom
New page
Top
A:
B: b3
c:
b3

Bottom
New page
Top
A:
B: b4
c: c4
b4
c4
Bottom
New page
Top
A: a5
B:
c:
a5

Bottom
New page
Top
A: a6
B:
c: c6
a6
c6
Bottom
New page
Top
A: a7
B: b7
c:
a7
b7

Bottom
New page
Top
A: a8
B: b8
c: c8
a8
b8
c8
Bottom

---------------------------------------------------

(without the
---------------------------------------------------
!)

That is in fact what I get, both in Word 2003 and Word 2007.

Just to be sure, if I copy the content of my mail merge main document,
convert that document into a label merge main document, paste the
content into label one, remove any additional paragraph marks at the
bottom of the cell, propagate labels and merge, I get the same layouts
in each case.

The questions/points now a
a. are the outputs above the ones you expected from the field codes
you have? If not, then I'd say there's probably a misunderstanding about
what the field codes you have should do. For example, if you /also/ want
to suppress the C field when it is blank, you will need additional "IF
field coding".
b. if you actually go through the above steps, do you have different
results? If so, then either
- they are different because there are still ambiguities in the way
I have set up the document (i.e. where are the paragraph marks). We can
sort that out if necessary, or
- they really are different, in which case maybe you can point out
where the differences occur
c. if however, the expected results and the actual results all match
with mine, but you are still getting unexpected results with a simple
example such as the above but with /real data/, then maybe there is
something in your data that the above does not take account of
d. if the results are the same and everything works with /real data/
as well, then perhaps your field setup is much more complicated and we
need to look there for an answer. For example,
- field suppression simply does not work the same way when fields
are nested inside other fields such as IF, INCLUDETEXT etc.
- in the unlikely event that you also have bookmarks in your mail
merge main document, and the value of B could equal the name of one of
those bookmarks, and the bookmark result was blank, you would need to
put quotes around the { MERGFIELD B } test in the IF field, i.e.

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

rather than

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

(If you add a field like

{ SET b3 "" }

at the beginning of the test mail merge main document, update it, then
perform the merge, you will probably see what I mean.

If necessary I'll post these sample files on the web somewhere but I
won't be able to do that for a couple of days.

Peter Jamieson


Peter, this is incredible! I can't thank you enough for all your hard
work here. I'm sure others will come across this in their searches,
so it'll be good for others, too.

I can't make heads or tails of the situation yet, I'm afraid. I'm
going to have to just keep studying the problem from all these angles.
I can't yet figure out what's going wrong since everything seems that
it should work but it may lie in the fact that there are blank cells
all over the place. The trick may be in learning how to code for
these blanks perhaps ... ?

But thank you. I'll continue plugging away g.

http://tips.pjmsn.me.uk

StargateFan wrote:
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


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge - "Find" feature and new field not working Jan Mailmerge 1 April 10th 09 02:22 AM
Apply "format object" style change to all slides/images in a large MadeYourDay Microsoft Word Help 1 June 28th 08 08:34 PM
"Save" or "Open" feature on attachments donna[_2_] New Users 3 November 8th 07 04:58 PM
How can I create a "blank-if-empty" numeric input field in Word 20 Pete W. Microsoft Word Help 3 September 14th 07 06:31 AM
Have to use "Undo" to remove formatting from rest of document Jan Aucamp, Central African Republic Microsoft Word Help 1 September 7th 06 09:47 PM


All times are GMT +1. The time now is 12:38 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"