View Single Post
  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default HUGE if statements...lots of blank space

Hi Heather,

If the false result is empty, there's no need to include it at all. You'll
also note I left out most of the other double-quotes - if expression
consists of another field, they're not needed either.

Cheers

--
macropod
[MVP - Microsoft Word]


"Heather" wrote in message
oups.com...
I thought that a false result returning nothing should have "" double
quotations?


macropod wrote:
Hi Heather,

The trick to suppressing the inclusion of extraneous text, spaces &

carriage
returns/line feeds in to conditionally include them in your IF tests.

For example, instead of having a space after:
{IF{MERGEFIELD admittype}= HS {IF{MERGEFIELD evalcmp111}= 2010
{IF{MERGEFIELD evalcmpvalue111}= 80 {IF{MERGEFIELD evalcmpvalue111} 85
"{INCLUDETEXT "c:\\master_comment.doc" admission_award_80_to_84}"}}}}
when the result is empty, delete the space following the field and

encode
the field as:
{IF{MERGEFIELD admittype}= HS {IF{MERGEFIELD evalcmp111}= 2010
{IF{MERGEFIELD evalcmpvalue111}= 80 {IF{MERGEFIELD evalcmpvalue111} 85
"{INCLUDETEXT "c:\\master_comment.doc" admission_award_80_to_84} "}}}}

You can replace the space following the INCLUDETEXT field with a text

string
and/or a carriage return/line feed, if appropriate. You can just as

readily
incorporate the conditional text, spaces & carriage returns/line feeds

ahead
of the INCLUDETEXT field - you can even do both. Simply put all of the
conditional text within the quote characters used to define the bounds

of
the true result.


Cheers

--
macropod
[MVP - Microsoft Word]


"Heather" wrote in message
oups.com...
Twice in a day...sorry, guys.

So I'm working on my merge codes, and the document is insanely large.
Like, really big. Pages and pages of merge code IF statements - there
are a ton of variables. My two page letter is up to 12 pages of merge
code.

Problem is that when I have false results, and I specify "", I'm
getting a huge amount of blank space in my letters after I complete

the
merge.

Thoughts? Would a switch help with something like this?

Heather