Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default HUGE if statements...lots of blank space

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

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default HUGE if statements...lots of blank space

Oh - and I'm using Word 2003.

Heather

  #3   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,

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



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default HUGE if statements...lots of blank space

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


  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default HUGE if statements...lots of blank space

It's difficult to tell why without seeing the document or a really accurate
transcription of the field codes, but my best guess is as follows.

Suppose you have

a
{ IF b = c "d" "" }
{ IF e = f "g" "" }
i

then if both comparisons fail you will get

a


i

because there is a paragraph mark after each IF field, and it will always be
inserted.

If you use

a{ IF b = c "d" "" }{ IF e = f "g" "" }i

you won't get these extra paragraph marks.

If you want to long chunks of field codes a bit easier to read (but with
more problems switching from field code view to field result view, because
of repagination, unless you're in "Normal View"), you can use

a{ IF b = c "d" ""
}{ IF e = f "g" ""
}i

Peter Jamieson

"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






  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default HUGE if statements...lots of blank space

I've been really careeful to keep an eye on paragraph marks after my IF
fields...I'm starting to think that the larger issue is the sheer
amount of code I'm putting into these letters. Here is an example:

http://www.flickr.com/photos/lectio/291618325/

That is a working copy of my code, with white space inserted in between
each block of IF statements. When I paste it into my template letter, I
go through and delete all of the paragraphs and make it one big run-on
paragraph.

http://www.flickr.com/photos/lectio/291622301/

That's as much as I could fit into a single screenshot. But there are
pages and pages of this...yesterday afternoon, I hit 12 pages of code
for a two page letter.

I'm trying reducing the code in the main letter to reference just two
of the conditions, and then merge a document into the letter if both
are true...that seems to be cutting down on the insertion of the white
space.

http://www.flickr.com/photos/lectio/291623913/

I really appreciate your help (and macropods, and Graham, and others)
with this. Learning this code has been really difficult!

Heather

Peter Jamieson wrote:
It's difficult to tell why without seeing the document or a really accurate
transcription of the field codes, but my best guess is as follows.

Suppose you have

a
{ IF b = c "d" "" }
{ IF e = f "g" "" }
i

then if both comparisons fail you will get

a


i

because there is a paragraph mark after each IF field, and it will always be
inserted.

If you use

a{ IF b = c "d" "" }{ IF e = f "g" "" }i

you won't get these extra paragraph marks.

If you want to long chunks of field codes a bit easier to read (but with
more problems switching from field code view to field result view, because
of repagination, unless you're in "Normal View"), you can use

a{ IF b = c "d" ""
}{ IF e = f "g" ""
}i

Peter Jamieson

"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



  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default HUGE if statements...lots of blank space

Well...sort of a fix, but it still doesn't solve the original problem.
But...it's working, so I'll just go with it.

I found some macro code and edited it some - so any instance of three
paragraph marks will be deleted. The ultimate solution - at this point
- will be to apply styles to my letters so that I don't have any double
paragraph marks, which would allow the letters to be refined even
further.

Sub ReplacePara()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^p^p^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Find.Execute
Wend
End Sub

Seven days to go-live...not that I'm counting....


Heather wrote:
I've been really careeful to keep an eye on paragraph marks after my IF
fields...I'm starting to think that the larger issue is the sheer
amount of code I'm putting into these letters. Here is an example:

http://www.flickr.com/photos/lectio/291618325/

That is a working copy of my code, with white space inserted in between
each block of IF statements. When I paste it into my template letter, I
go through and delete all of the paragraphs and make it one big run-on
paragraph.

http://www.flickr.com/photos/lectio/291622301/

That's as much as I could fit into a single screenshot. But there are
pages and pages of this...yesterday afternoon, I hit 12 pages of code
for a two page letter.

I'm trying reducing the code in the main letter to reference just two
of the conditions, and then merge a document into the letter if both
are true...that seems to be cutting down on the insertion of the white
space.

http://www.flickr.com/photos/lectio/291623913/

I really appreciate your help (and macropods, and Graham, and others)
with this. Learning this code has been really difficult!

Heather

Peter Jamieson wrote:
It's difficult to tell why without seeing the document or a really accurate
transcription of the field codes, but my best guess is as follows.

Suppose you have

a
{ IF b = c "d" "" }
{ IF e = f "g" "" }
i

then if both comparisons fail you will get

a


i

because there is a paragraph mark after each IF field, and it will always be
inserted.

If you use

a{ IF b = c "d" "" }{ IF e = f "g" "" }i

you won't get these extra paragraph marks.

If you want to long chunks of field codes a bit easier to read (but with
more problems switching from field code view to field result view, because
of repagination, unless you're in "Normal View"), you can use

a{ IF b = c "d" ""
}{ IF e = f "g" ""
}i

Peter Jamieson

"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



  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default HUGE if statements...lots of blank space

I had the impression that you were sure that this extra space was coming in
via "false" evaluations in the IF fields, but just to be certain, could it
be coming in because the bookmarks in your included documents cover
paragraph marks and/or other white space?

I have to say that when I try this here (in a simplifed case where I just
replicate the IF field a few hundred times) I don't get any extra white
space except the stuff that comes in from bookmarks.

Peter Jamieson


"Heather" wrote in message
ups.com...
I've been really careeful to keep an eye on paragraph marks after my IF
fields...I'm starting to think that the larger issue is the sheer
amount of code I'm putting into these letters. Here is an example:

http://www.flickr.com/photos/lectio/291618325/

That is a working copy of my code, with white space inserted in between
each block of IF statements. When I paste it into my template letter, I
go through and delete all of the paragraphs and make it one big run-on
paragraph.

http://www.flickr.com/photos/lectio/291622301/

That's as much as I could fit into a single screenshot. But there are
pages and pages of this...yesterday afternoon, I hit 12 pages of code
for a two page letter.

I'm trying reducing the code in the main letter to reference just two
of the conditions, and then merge a document into the letter if both
are true...that seems to be cutting down on the insertion of the white
space.

http://www.flickr.com/photos/lectio/291623913/

I really appreciate your help (and macropods, and Graham, and others)
with this. Learning this code has been really difficult!

Heather

Peter Jamieson wrote:
It's difficult to tell why without seeing the document or a really
accurate
transcription of the field codes, but my best guess is as follows.

Suppose you have

a
{ IF b = c "d" "" }
{ IF e = f "g" "" }
i

then if both comparisons fail you will get

a


i

because there is a paragraph mark after each IF field, and it will always
be
inserted.

If you use

a{ IF b = c "d" "" }{ IF e = f "g" "" }i

you won't get these extra paragraph marks.

If you want to long chunks of field codes a bit easier to read (but with
more problems switching from field code view to field result view,
because
of repagination, unless you're in "Normal View"), you can use

a{ IF b = c "d" ""
}{ IF e = f "g" ""
}i

Peter Jamieson

"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





  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default HUGE if statements...lots of blank space

I don't _think_ so, but I could be wrong. I have inspected the
bookmarks to look for extra paragraph marks and white space...but I
could be missing something. But it seemed like this problem of the
gigantor white space didn't seem to arise until my merge codes started
going on for more than 15-20 lines. I haven't found any documentation
to support that theory...but now that I've hit the fifteenth page of
code for a two page letter, I suspect it might be the case.

I'm definitely not the expert, though. But apply a style to the overall
template and then running a macro to take out the extra paragraph
results is doing what I need it to do. Very weird.

Generally speaking, how does the spacing within an {if
{mergefield...}""} code impact the final spacing in a merged letter?

Heather


Peter Jamieson wrote:
I had the impression that you were sure that this extra space was coming in
via "false" evaluations in the IF fields, but just to be certain, could it
be coming in because the bookmarks in your included documents cover
paragraph marks and/or other white space?

I have to say that when I try this here (in a simplifed case where I just
replicate the IF field a few hundred times) I don't get any extra white
space except the stuff that comes in from bookmarks.

Peter Jamieson


"Heather" wrote in message
ups.com...
I've been really careeful to keep an eye on paragraph marks after my IF
fields...I'm starting to think that the larger issue is the sheer
amount of code I'm putting into these letters. Here is an example:

http://www.flickr.com/photos/lectio/291618325/

That is a working copy of my code, with white space inserted in between
each block of IF statements. When I paste it into my template letter, I
go through and delete all of the paragraphs and make it one big run-on
paragraph.

http://www.flickr.com/photos/lectio/291622301/

That's as much as I could fit into a single screenshot. But there are
pages and pages of this...yesterday afternoon, I hit 12 pages of code
for a two page letter.

I'm trying reducing the code in the main letter to reference just two
of the conditions, and then merge a document into the letter if both
are true...that seems to be cutting down on the insertion of the white
space.

http://www.flickr.com/photos/lectio/291623913/

I really appreciate your help (and macropods, and Graham, and others)
with this. Learning this code has been really difficult!

Heather

Peter Jamieson wrote:
It's difficult to tell why without seeing the document or a really
accurate
transcription of the field codes, but my best guess is as follows.

Suppose you have

a
{ IF b = c "d" "" }
{ IF e = f "g" "" }
i

then if both comparisons fail you will get

a


i

because there is a paragraph mark after each IF field, and it will always
be
inserted.

If you use

a{ IF b = c "d" "" }{ IF e = f "g" "" }i

you won't get these extra paragraph marks.

If you want to long chunks of field codes a bit easier to read (but with
more problems switching from field code view to field result view,
because
of repagination, unless you're in "Normal View"), you can use

a{ IF b = c "d" ""
}{ IF e = f "g" ""
}i

Peter Jamieson

"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




  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default HUGE if statements...lots of blank space

All my efforts to complicate and lengthen/deepen my own test sample haven't
revealed the problem yet, but my sample is still rather simple..

I haven't found any documentation
to support that theory...but now that I've hit the fifteenth page of
code for a two page letter, I suspect it might be the case.


It could well be. If you would like a second opinion and feel able to
provide the document and a suitable sample data source I can certainly have
a look here, probably tomorrow (Wednesday).

Peter Jamieson

"Heather" wrote in message
ps.com...
I don't _think_ so, but I could be wrong. I have inspected the
bookmarks to look for extra paragraph marks and white space...but I
could be missing something. But it seemed like this problem of the
gigantor white space didn't seem to arise until my merge codes started
going on for more than 15-20 lines. I haven't found any documentation
to support that theory...but now that I've hit the fifteenth page of
code for a two page letter, I suspect it might be the case.

I'm definitely not the expert, though. But apply a style to the overall
template and then running a macro to take out the extra paragraph
results is doing what I need it to do. Very weird.

Generally speaking, how does the spacing within an {if
{mergefield...}""} code impact the final spacing in a merged letter?

Heather


Peter Jamieson wrote:
I had the impression that you were sure that this extra space was coming
in
via "false" evaluations in the IF fields, but just to be certain, could
it
be coming in because the bookmarks in your included documents cover
paragraph marks and/or other white space?

I have to say that when I try this here (in a simplifed case where I just
replicate the IF field a few hundred times) I don't get any extra white
space except the stuff that comes in from bookmarks.

Peter Jamieson


"Heather" wrote in message
ups.com...
I've been really careeful to keep an eye on paragraph marks after my IF
fields...I'm starting to think that the larger issue is the sheer
amount of code I'm putting into these letters. Here is an example:

http://www.flickr.com/photos/lectio/291618325/

That is a working copy of my code, with white space inserted in between
each block of IF statements. When I paste it into my template letter, I
go through and delete all of the paragraphs and make it one big run-on
paragraph.

http://www.flickr.com/photos/lectio/291622301/

That's as much as I could fit into a single screenshot. But there are
pages and pages of this...yesterday afternoon, I hit 12 pages of code
for a two page letter.

I'm trying reducing the code in the main letter to reference just two
of the conditions, and then merge a document into the letter if both
are true...that seems to be cutting down on the insertion of the white
space.

http://www.flickr.com/photos/lectio/291623913/

I really appreciate your help (and macropods, and Graham, and others)
with this. Learning this code has been really difficult!

Heather

Peter Jamieson wrote:
It's difficult to tell why without seeing the document or a really
accurate
transcription of the field codes, but my best guess is as follows.

Suppose you have

a
{ IF b = c "d" "" }
{ IF e = f "g" "" }
i

then if both comparisons fail you will get

a


i

because there is a paragraph mark after each IF field, and it will
always
be
inserted.

If you use

a{ IF b = c "d" "" }{ IF e = f "g" "" }i

you won't get these extra paragraph marks.

If you want to long chunks of field codes a bit easier to read (but
with
more problems switching from field code view to field result view,
because
of repagination, unless you're in "Normal View"), you can use

a{ IF b = c "d" ""
}{ IF e = f "g" ""
}i

Peter Jamieson

"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








  #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




  #12   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default HUGE if statements...lots of blank space

Thanks, Macropod. And thanks for the offer, Peter - I think I'll just
keep plugging away on my project for now.

Heather

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



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
blank space in merge Tatum Mailmerge 1 November 3rd 05 06:38 AM
How do I omit blank space in a document created with a template? anjajane Microsoft Word Help 5 October 6th 05 10:19 PM
Blank space at beginning of outline Dan Schaffer New Users 4 September 13th 05 11:54 PM
How do I add a space in a line if a merge field is blank? S Cocke Mailmerge 4 February 12th 05 12:13 AM
Why do I get a large blank space within my Word table? Todd F. Tables 1 November 4th 04 08:05 PM


All times are GMT +1. The time now is 09:31 PM.

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"