Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Ed Ed is offline
external usenet poster
 
Posts: 217
Default Word mailmerge how to do multiple If statements

Hi Peter,

Don't think I can be of any help with this one :-(

I found one thread in the NG which seems similar:

http://groups.google.co.uk/group/mic...9b11bc e3dc98

There, the problem seemed to be a possible font oddity.

I suppose you could try different fonts and see what happens.

I tried a test here with non-nested fields in Word 97, 2003 and 2007 and in
each case the blank lines were suppressed.

Answers to some of the following might spark a solution from someone in the
NGs.

What version of Word are you using?

Are the merge fields "free-standing" or are they embedded in other fields
(such as IF fields)? I ask because when Microsoft produced Word 2002 they
re-wrote the merge part and one of the changes was that there were some
circumstances where blank lines would no longer be suppressed automatically
(even when merging to a new document) and one of the circumstances was when
merge fields were inside IF fields. There are a couple of ways to work around
that particular problem.

If you turn on the display of formatting marks does anything unusual show up?

Does the problem happen with one mail merge main document or with all of them?

If you have access to a different printer does the problem happen when you
merge to that? (Seems likely if you also get the problem merging to PDF.)

If you copy everything from you mail merge main document except the last
paragraph mark into a new document and try the merge with that one do you
still get the problem?

If your mail merge main document is based on normal.dot, what happens if you
bypass normal.dot, create a new test document and merge that to the printer?
(To bypass normal.dot, start Word by clicking Start/Run and typing "winword
/a" (without the quotes) in the Run dialog. This will also stop any addins or
global templates loading.)

I've asked a bunch of questions and unfortunately I won't be around for the
rest of today to see the answers as I'm just about to leave the building, but
maybe somebody else will

Regards and good luck!.

Ed

"Peter" wrote:

Hi Ed,

I came across this post in a search regarding this type of merge. I tried
your advice and it worked. Thanks for all the information you've given.

I do have a question regarding the final merge output however. I noticed
that "do not print blank lines" seems to be ignored when merging the document
to a printer or even a pdf driver. If I merge to New Document , then the
blank lines do not appear. Any ideas?

Thanks again.

Peter


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Peter is offline
external usenet poster
 
Posts: 111
Default Word mailmerge how to do multiple If statements

Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code I have
I initially set with information from Microsoft, combined with your initial
suggestions. I have a link to a screen shot I took of the code I am using. I
did try keying in the code as you showed Pearl but the documents would not
come up. The code in the link gives me the documents, just will not supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter
  #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 Word mailmerge how to do multiple If statements

I don't know if it will make any difference, but the opening quote mark in
front of the true result in each If...then...Else construction should not be
there.

That is

{ IF { MERGEFIELD ALERT } = GEN "{ INCLUDETEXT etc

should only be

{ IF { MERGEFIELD ALERT } = GEN { INCLUDETEXT etc

--
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

"Peter" wrote in message
...
Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code I
have
I initially set with information from Microsoft, combined with your
initial
suggestions. I have a link to a screen shot I took of the code I am using.
I
did try keying in the code as you showed Pearl but the documents would not
come up. The code in the link gives me the documents, just will not
supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word mailmerge how to do multiple If statements

FYI blank line suppression does not work with fields nested in other fields
(such as INCLUDETEXT, IF) in Word 2002/2003. Or at least some versions of
it. Although I think it did work with Word 2000,
a. I probably mostly merged to new documents, not the printer
b. various aspects of field behaviour have been changed with service packs
and security updates in Word 2000. This /could/ be one of them. If so, it
could be that the only way you will get these fields to function correctly
is to use the other, more complex technique of inserting blank lines when
the fields are not empty, e.g.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

I'm not sure I can get at my Word 2000 system right now but when I can I'll
take a look. Which Word SR/SP are you using?

Peter Jamieson

"Peter" wrote in message
...
Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code I
have
I initially set with information from Microsoft, combined with your
initial
suggestions. I have a link to a screen shot I took of the code I am using.
I
did try keying in the code as you showed Pearl but the documents would not
come up. The code in the link gives me the documents, just will not
supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word mailmerge how to do multiple If statements

I've now had another look at this on Word 2000 SP3 (not fully patched
though) and the current patched version of Word 2003.

Using relatively simple tests (i.e. may not be the whole story):
a. the behaviour is the same in both versions
b. the print and the preview are the same on both versions, but the results
when merging to a new document are different
c. for fields inside an INCLUDETEXT, the technique described in my previous
post consistently achieves suppression on both versions of Word, i.e. unless
someone knows a better way, it's the way to go.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

d. MERGEFIELDs inside an IF /in the main document/ (e.g.

{ IF 1 = 1 "{ MERGEFIELD a }
{ MERGEFIELD b }" "" }

are never suppressed

e. When you merge to a new document, there is a difference between the
behaviour of an INCLUDETEXT that is nested in an IF in the main document,
and an INCLUDETEXT that is not nested:

The result of an { INCLUDETEXT "pathname" } is that
1. the INCLUDETEXT is retained
2. fields are not suppressed
3. the output document looks the same as the preview and printed version

The result of an { IF 1 = 1 "{ INCLUDETEXT "pathname" }" "" } is that
4. the INCLUDETEXT is resolved
5. fields are suppressed, as long as they are not also nested inside an IF
inside the INCLUETEXTed document
6. the output document may therefore not look like the preview and printed
version.

Peter Jamieson

"Peter Jamieson" wrote in message
...
FYI blank line suppression does not work with fields nested in other
fields (such as INCLUDETEXT, IF) in Word 2002/2003. Or at least some
versions of it. Although I think it did work with Word 2000,
a. I probably mostly merged to new documents, not the printer
b. various aspects of field behaviour have been changed with service packs
and security updates in Word 2000. This /could/ be one of them. If so, it
could be that the only way you will get these fields to function correctly
is to use the other, more complex technique of inserting blank lines when
the fields are not empty, e.g.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

I'm not sure I can get at my Word 2000 system right now but when I can
I'll take a look. Which Word SR/SP are you using?

Peter Jamieson

"Peter" wrote in message
...
Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code I
have
I initially set with information from Microsoft, combined with your
initial
suggestions. I have a link to a screen shot I took of the code I am
using. I
did try keying in the code as you showed Pearl but the documents would
not
come up. The code in the link gives me the documents, just will not
supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter







  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Pearl Pearl is offline
external usenet poster
 
Posts: 7
Default Word mailmerge how to do multiple If statements

Hi Peter and Ed. I tried out the suggestion for nested If statements from Ed
using a simple data source in Excel 2003 to a Word 2003 merge doc and it
worked really well. I got to 9 nested Ifs and put in a dummy code to test the
FalseText with no problems.
The reason I originally raised the query was because I was having problems
getting data out of a 3rd party software system into a merge doc. Only one of
the code conversions worked and I thought that this was because of the way I
was constructing the If statements. Turns out that the system is only
recording one code when it should be recording more - so I think a fix is
required!!
Thanks for the great advice here. My query seems to have generated further
queries relating to different versions of Word. Well I use Office 2000 at
work so I'll be trying out my test mail merge that I've created in 2003 there
on Monday so I'll let you know if it still works :-)

Still don't know how many nested IFs Word will take, I need about 16 in all
so I'll keep going and let you all know how I get on


Still don't know how many nested Ifs Word will take, I need about 16 in all
so I'll keep going and let you all know how I get on.
"Peter Jamieson" wrote:

I've now had another look at this on Word 2000 SP3 (not fully patched
though) and the current patched version of Word 2003.

Using relatively simple tests (i.e. may not be the whole story):
a. the behaviour is the same in both versions
b. the print and the preview are the same on both versions, but the results
when merging to a new document are different
c. for fields inside an INCLUDETEXT, the technique described in my previous
post consistently achieves suppression on both versions of Word, i.e. unless
someone knows a better way, it's the way to go.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

d. MERGEFIELDs inside an IF /in the main document/ (e.g.

{ IF 1 = 1 "{ MERGEFIELD a }
{ MERGEFIELD b }" "" }

are never suppressed

e. When you merge to a new document, there is a difference between the
behaviour of an INCLUDETEXT that is nested in an IF in the main document,
and an INCLUDETEXT that is not nested:

The result of an { INCLUDETEXT "pathname" } is that
1. the INCLUDETEXT is retained
2. fields are not suppressed
3. the output document looks the same as the preview and printed version

The result of an { IF 1 = 1 "{ INCLUDETEXT "pathname" }" "" } is that
4. the INCLUDETEXT is resolved
5. fields are suppressed, as long as they are not also nested inside an IF
inside the INCLUETEXTed document
6. the output document may therefore not look like the preview and printed
version.

Peter Jamieson

"Peter Jamieson" wrote in message
...
FYI blank line suppression does not work with fields nested in other
fields (such as INCLUDETEXT, IF) in Word 2002/2003. Or at least some
versions of it. Although I think it did work with Word 2000,
a. I probably mostly merged to new documents, not the printer
b. various aspects of field behaviour have been changed with service packs
and security updates in Word 2000. This /could/ be one of them. If so, it
could be that the only way you will get these fields to function correctly
is to use the other, more complex technique of inserting blank lines when
the fields are not empty, e.g.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

I'm not sure I can get at my Word 2000 system right now but when I can
I'll take a look. Which Word SR/SP are you using?

Peter Jamieson

"Peter" wrote in message
...
Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code I
have
I initially set with information from Microsoft, combined with your
initial
suggestions. I have a link to a screen shot I took of the code I am
using. I
did try keying in the code as you showed Pearl but the documents would
not
come up. The code in the link gives me the documents, just will not
supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter






  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word mailmerge how to do multiple If statements

The limit for nesting is around 19 or 20 levels. It has been documented (I
think the documentation says "20", but it depends how you count), but
a. I cannot point you to a definitive statement
b. it's possible it has changed in Word 2007.

Peter Jamieson
"Pearl" wrote in message
...
Hi Peter and Ed. I tried out the suggestion for nested If statements from
Ed
using a simple data source in Excel 2003 to a Word 2003 merge doc and it
worked really well. I got to 9 nested Ifs and put in a dummy code to test
the
FalseText with no problems.
The reason I originally raised the query was because I was having problems
getting data out of a 3rd party software system into a merge doc. Only one
of
the code conversions worked and I thought that this was because of the way
I
was constructing the If statements. Turns out that the system is only
recording one code when it should be recording more - so I think a fix is
required!!
Thanks for the great advice here. My query seems to have generated further
queries relating to different versions of Word. Well I use Office 2000 at
work so I'll be trying out my test mail merge that I've created in 2003
there
on Monday so I'll let you know if it still works :-)

Still don't know how many nested IFs Word will take, I need about 16 in
all
so I'll keep going and let you all know how I get on?


Still don't know how many nested Ifs Word will take, I need about 16 in
all
so I'll keep going and let you all know how I get on.
"Peter Jamieson" wrote:

I've now had another look at this on Word 2000 SP3 (not fully patched
though) and the current patched version of Word 2003.

Using relatively simple tests (i.e. may not be the whole story):
a. the behaviour is the same in both versions
b. the print and the preview are the same on both versions, but the
results
when merging to a new document are different
c. for fields inside an INCLUDETEXT, the technique described in my
previous
post consistently achieves suppression on both versions of Word, i.e.
unless
someone knows a better way, it's the way to go.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

d. MERGEFIELDs inside an IF /in the main document/ (e.g.

{ IF 1 = 1 "{ MERGEFIELD a }
{ MERGEFIELD b }" "" }

are never suppressed

e. When you merge to a new document, there is a difference between the
behaviour of an INCLUDETEXT that is nested in an IF in the main document,
and an INCLUDETEXT that is not nested:

The result of an { INCLUDETEXT "pathname" } is that
1. the INCLUDETEXT is retained
2. fields are not suppressed
3. the output document looks the same as the preview and printed version

The result of an { IF 1 = 1 "{ INCLUDETEXT "pathname" }" "" } is that
4. the INCLUDETEXT is resolved
5. fields are suppressed, as long as they are not also nested inside an
IF
inside the INCLUETEXTed document
6. the output document may therefore not look like the preview and
printed
version.

Peter Jamieson

"Peter Jamieson" wrote in message
...
FYI blank line suppression does not work with fields nested in other
fields (such as INCLUDETEXT, IF) in Word 2002/2003. Or at least some
versions of it. Although I think it did work with Word 2000,
a. I probably mostly merged to new documents, not the printer
b. various aspects of field behaviour have been changed with service
packs
and security updates in Word 2000. This /could/ be one of them. If so,
it
could be that the only way you will get these fields to function
correctly
is to use the other, more complex technique of inserting blank lines
when
the fields are not empty, e.g.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

I'm not sure I can get at my Word 2000 system right now but when I can
I'll take a look. Which Word SR/SP are you using?

Peter Jamieson

"Peter" wrote in message
...
Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code
I
have
I initially set with information from Microsoft, combined with your
initial
suggestions. I have a link to a screen shot I took of the code I am
using. I
did try keying in the code as you showed Pearl but the documents would
not
come up. The code in the link gives me the documents, just will not
supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter







  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Pearl Pearl is offline
external usenet poster
 
Posts: 7
Default Word mailmerge how to do multiple If statements

Thank you Peter, that should be enough for my needs at present. I did try it
out in Word / Excel 2000 and OK, the mail merge process is different to
Office 2003, but it worked all right. Tried several times to print out the If
statement and kept getting the result rather than the field codes but managed
to get it to print out all right in the end. I've learned so much more about
Word/mail merge in the past few days. Thank u all for your help, it's much
appreciated. :-)

"Peter Jamieson" wrote:

The limit for nesting is around 19 or 20 levels. It has been documented (I
think the documentation says "20", but it depends how you count), but
a. I cannot point you to a definitive statement
b. it's possible it has changed in Word 2007.

Peter Jamieson
"Pearl" wrote in message
...
Hi Peter and Ed. I tried out the suggestion for nested If statements from
Ed
using a simple data source in Excel 2003 to a Word 2003 merge doc and it
worked really well. I got to 9 nested Ifs and put in a dummy code to test
the
FalseText with no problems.
The reason I originally raised the query was because I was having problems
getting data out of a 3rd party software system into a merge doc. Only one
of
the code conversions worked and I thought that this was because of the way
I
was constructing the If statements. Turns out that the system is only
recording one code when it should be recording more - so I think a fix is
required!!
Thanks for the great advice here. My query seems to have generated further
queries relating to different versions of Word. Well I use Office 2000 at
work so I'll be trying out my test mail merge that I've created in 2003
there
on Monday so I'll let you know if it still works :-)

Still don't know how many nested IFs Word will take, I need about 16 in
all
so I'll keep going and let you all know how I get on?


Still don't know how many nested Ifs Word will take, I need about 16 in
all
so I'll keep going and let you all know how I get on.
"Peter Jamieson" wrote:

I've now had another look at this on Word 2000 SP3 (not fully patched
though) and the current patched version of Word 2003.

Using relatively simple tests (i.e. may not be the whole story):
a. the behaviour is the same in both versions
b. the print and the preview are the same on both versions, but the
results
when merging to a new document are different
c. for fields inside an INCLUDETEXT, the technique described in my
previous
post consistently achieves suppression on both versions of Word, i.e.
unless
someone knows a better way, it's the way to go.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

d. MERGEFIELDs inside an IF /in the main document/ (e.g.

{ IF 1 = 1 "{ MERGEFIELD a }
{ MERGEFIELD b }" "" }

are never suppressed

e. When you merge to a new document, there is a difference between the
behaviour of an INCLUDETEXT that is nested in an IF in the main document,
and an INCLUDETEXT that is not nested:

The result of an { INCLUDETEXT "pathname" } is that
1. the INCLUDETEXT is retained
2. fields are not suppressed
3. the output document looks the same as the preview and printed version

The result of an { IF 1 = 1 "{ INCLUDETEXT "pathname" }" "" } is that
4. the INCLUDETEXT is resolved
5. fields are suppressed, as long as they are not also nested inside an
IF
inside the INCLUETEXTed document
6. the output document may therefore not look like the preview and
printed
version.

Peter Jamieson

"Peter Jamieson" wrote in message
...
FYI blank line suppression does not work with fields nested in other
fields (such as INCLUDETEXT, IF) in Word 2002/2003. Or at least some
versions of it. Although I think it did work with Word 2000,
a. I probably mostly merged to new documents, not the printer
b. various aspects of field behaviour have been changed with service
packs
and security updates in Word 2000. This /could/ be one of them. If so,
it
could be that the only way you will get these fields to function
correctly
is to use the other, more complex technique of inserting blank lines
when
the fields are not empty, e.g.

{ IF "{ MERGEFIELD myfield1 }" = ""
"" "{ MERGEFIELD myfield1 }
" }{ IF "{ MERGEFIELD myfield2 }" = ""
"" "{ MERGEFIELD myfield2 }
" }

I'm not sure I can get at my Word 2000 system right now but when I can
I'll take a look. Which Word SR/SP are you using?

Peter Jamieson

"Peter" wrote in message
...
Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code
I
have
I initially set with information from Microsoft, combined with your
initial
suggestions. I have a link to a screen shot I took of the code I am
using. I
did try keying in the code as you showed Pearl but the documents would
not
come up. The code in the link gives me the documents, just will not
supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter








  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Ed Ed is offline
external usenet poster
 
Posts: 217
Default Word mailmerge how to do multiple If statements

Hi Peter,

I can't actually see your example as our company firewall (or whatever)
blocks access to lots of sites.

But I see that Peter J is on the case so it doesn't matter anyway

Regards.

Ed

"Peter" wrote:

Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code I have
I initially set with information from Microsoft, combined with your initial
suggestions. I have a link to a screen shot I took of the code I am using. I
did try keying in the code as you showed Pearl but the documents would not
come up. The code in the link gives me the documents, just will not supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter

  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word mailmerge how to do multiple If statements

Ed

You are more confident than I am :-)

test, test, and test again may be my motto but $0, $0 and $0 are the usual
rewards :-))

Peter Jamieson
"Ed" wrote in message
...
Hi Peter,

I can't actually see your example as our company firewall (or whatever)
blocks access to lots of sites.

But I see that Peter J is on the case so it doesn't matter anyway

Regards.

Ed

"Peter" wrote:

Thanks again Ed.

Really appreciate all your advice!

I am using Ver 2000.

I have tried various things you have mentioned, but no luck. The code I
have
I initially set with information from Microsoft, combined with your
initial
suggestions. I have a link to a screen shot I took of the code I am
using. I
did try keying in the code as you showed Pearl but the documents would
not
come up. The code in the link gives me the documents, just will not
supress
blank lines unless I merge to a new document.

http://img.photobucket.com/albums/v2...g?t=1177710767

Thanks again . . .

Peter





  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Peter is offline
external usenet poster
 
Posts: 111
Default Word mailmerge how to do multiple If statements

Hi Doug, Peter and Ed,

Really appreciate all your advice and tips. I have being trying all the
various tests as suggested. The end result is that I am still getting the
blank line on merge outputs other than new document. When I get back to my
office tomorrow I will apply the SP3 pack to my MS Word. Not sure if that
alone will make the difference in all of this.

Depending on the project deadline I may just apply the merge to a new
document and then print pdf files from there. Creating new documents for me
creates a real slow down in my project. I have over 14,000 letters to merge
from 5 different letter formats. Even though I merge in blocks of 500, the
merge to "new document" is very slow (even with the spell check off).

Anyway, thanks again. Frankly, I'm blown away by your efforts and advice .
.. . much appreciate it!

Peter
ps - I will let you know if I resolve the problem . . .


  #12   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word mailmerge how to do multiple If statements

It would surprise me if the

{ IF "{ MERGEFIELD x }" = "" ""
"{ MERGEFIELD x }
" }

approach did not work, but you do have to get the overall layout right.

If you have

before
{ MERGEFIELD x }
after

and you want a blank { MERGEFIELD x } to result in

before
after

then you have to use something like

before
{ IF "{ MERGEFIELD x }" = "" ""
"{ MERGEFIELD x }
" }after

or if you prefer fewer lines

before
{ IF "{ MERGEFIELD x }" = "" "" "{ MERGEFIELD x }
" }after

not

before
{ IF "{ MERGEFIELD x }" = "" "" "{ MERGEFIELD x }
" }
after

but perhaps that doesn't work on your setup either...

Peter Jamieson

"Peter" wrote in message
...
Hi Doug, Peter and Ed,

Really appreciate all your advice and tips. I have being trying all the
various tests as suggested. The end result is that I am still getting the
blank line on merge outputs other than new document. When I get back to my
office tomorrow I will apply the SP3 pack to my MS Word. Not sure if that
alone will make the difference in all of this.

Depending on the project deadline I may just apply the merge to a new
document and then print pdf files from there. Creating new documents for
me
creates a real slow down in my project. I have over 14,000 letters to
merge
from 5 different letter formats. Even though I merge in blocks of 500, the
merge to "new document" is very slow (even with the spell check off).

Anyway, thanks again. Frankly, I'm blown away by your efforts and advice
.
. . much appreciate it!

Peter
ps - I will let you know if I resolve the problem . . .




  #13   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Peter is offline
external usenet poster
 
Posts: 111
Default Word mailmerge how to do multiple If statements

Hi Peter,

Please bear with me on this since I am very green with the "IF" statements.

I created a new document and put in the following single line:

{ IF "{ MERGEFIELD ALERT }"= "GEN" "{INCLUDETEXT"C:\\Mer\\Gen.doc"}"
"{MERGEFIELD ALERT}"}

I still get the blank field printed. I did check the Gen.doc itself and it
does not print the blank field.

Again, I am green at IF statements and perhaps I'm missing some things in
the document properties as well . . . and your comment: "but you do have to
get the overall layout right" . . . I agree; perhaps I am overlooking
something.

I have been attempting a SP upgrade from SP1 to SP3. SP1 was a success but
SP3 is giving some difficulty in that it looks for DATA1.MSI for SP1 which of
course does not exist on my original Office 2000 CD. Anyway, a different
matter altogether and I don't even know if the SP3 will address the "blank
field printing" issue.

Thanks again!

Peter

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
if statements with dates in mailmerge walkerh Mailmerge 3 April 9th 07 06:17 PM
How do I insert multiple hyperlinks in if, then, else statements? QUCJ Microsoft Word Help 0 September 21st 05 01:52 PM
How do i use multiple IF statements in word 2000? dg Mailmerge 1 August 18th 05 06:24 AM
MERGE: Can I have multiple SET statements based on one IF Bill Anderson Mailmerge 1 February 24th 05 06:03 AM
MERGE: Can I have multiple SET statements based on one IF Bill Anderson Mailmerge 0 February 24th 05 01:27 AM


All times are GMT +1. The time now is 11:16 PM.

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

About Us

"It's about Microsoft Word"