Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] john@jdraper.net is offline
external usenet poster
 
Posts: 5
Default Another Mail Merge Problem - Word 2003

I have two Mergefields on the same line County and PostCode.
In some cases, like sending a letter to Australia, the County field is
blank but the PostCode field contains data. In an earlier post Doug
Robbins showed me how to use If-Then-Else coding to print, one or
other or both fields but I've hit another problem.

Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank, the
line remains, so I get a blank line between "Town" and "Country".
I've tried using a second "If" statement but it makes no difference.
Could someone please advise how I can get rid of the blank line.

Best Regards
John

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Another Mail Merge Problem - Word 2003

How about

{ IF "{ MERGEFIELD County }" = "" "" "{ MERGEFIELD County } " }{ MERGEFIELD
Postcode }

The thing about blank line suppression is that it isn't any old blank line
that's suppressed - it's blank lines formed from MERGEFIELD fields, but
MERGEFIELD fields nested inside some other construct such as an IF field
don't count. So only by inserting a MERGEFIELD that you know to be blank can
you suppress the line.

More or less.

Peter Jamieson

wrote in message
oups.com...
I have two Mergefields on the same line County and PostCode.
In some cases, like sending a letter to Australia, the County field is
blank but the PostCode field contains data. In an earlier post Doug
Robbins showed me how to use If-Then-Else coding to print, one or
other or both fields but I've hit another problem.

Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank, the
line remains, so I get a blank line between "Town" and "Country".
I've tried using a second "If" statement but it makes no difference.
Could someone please advise how I can get rid of the blank line.

Best Regards
John



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] john@jdraper.net is offline
external usenet poster
 
Posts: 5
Default Another Mail Merge Problem - Word 2003

Peter,

Thanks for the advice. The code at present is as follows:

{ IF { MERGEFIELD Country } = "" { MERGEFIELD PostCode }
"{ MERGEFIELD
Country } { MERGEFIELD PostCode }" }

I understand what you are saying but, if, as you suggest, I put
{Mergefield Postcode} at the end, it will be OK if Potscode is blank
but if it is not, I will get Postcode twice.

I'm not sure how this solves the problem.

Best Regards
John

On 16 Mar, 13:15, "Peter Jamieson"
wrote:
How about

{ IF "{ MERGEFIELD County }" = "" "" "{ MERGEFIELD County } " }{ MERGEFIELD
Postcode }

The thing about blank line suppression is that it isn't any old blank line
that's suppressed - it's blank lines formed from MERGEFIELD fields, but
MERGEFIELD fields nested inside some other construct such as an IF field
don't count. So only by inserting a MERGEFIELD that you know to be blank can
you suppress the line.

More or less.

Peter Jamieson

wrote in message

oups.com...



I have two Mergefields on the same line County and PostCode.
In some cases, like sending a letter to Australia, the County field is
blank but the PostCode field contains data. In an earlier post Doug
Robbins showed me how to use If-Then-Else coding to print, one or
other or both fields but I've hit another problem.


Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank, the
line remains, so I get a blank line between "Town" and "Country".
I've tried using a second "If" statement but it makes no difference.
Could someone please advise how I can get rid of the blank line.


Best Regards
John- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] john@jdraper.net is offline
external usenet poster
 
Posts: 5
Default Another Mail Merge Problem - Word 2003

Thanks Graham,

It seems very complicated but it works - I won't pretend to understand
how!

Best Regards
John

On 16 Mar, 13:33, wrote:
Peter,

Thanks for the advice. The code at present is as follows:

{ IF { MERGEFIELD Country } = "" { MERGEFIELD PostCode }
"{ MERGEFIELD
Country } { MERGEFIELD PostCode }" }

I understand what you are saying but, if, as you suggest, I put
{Mergefield Postcode} at the end, it will be OK if Potscode is blank
but if it is not, I will get Postcode twice.

I'm not sure how this solves the problem.

Best Regards
John

On 16 Mar, 13:15, "Peter Jamieson"
wrote:



How about


{ IF "{ MERGEFIELD County }" = "" "" "{ MERGEFIELD County } " }{ MERGEFIELD
Postcode }


The thing about blank line suppression is that it isn't any old blank line
that's suppressed - it's blank lines formed from MERGEFIELD fields, but
MERGEFIELD fields nested inside some other construct such as an IF field
don't count. So only by inserting a MERGEFIELD that you know to be blank can
you suppress the line.


More or less.


Peter Jamieson


wrote in message


roups.com...


I have two Mergefields on the same line County and PostCode.
In some cases, like sending a letter to Australia, the County field is
blank but the PostCode field contains data. In an earlier post Doug
Robbins showed me how to use If-Then-Else coding to print, one or
other or both fields but I've hit another problem.


Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank, the
line remains, so I get a blank line between "Town" and "Country".
I've tried using a second "If" statement but it makes no difference.
Could someone please advise how I can get rid of the blank line.


Best Regards
John- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Another Mail Merge Problem - Word 2003


I understand what you are saying but, if, as you suggest, I put
{Mergefield Postcode} at the end, it will be OK if Potscode is blank
but if it is not, I will get Postcode twice.


I don't think so, with the code I posted, unless you also have { MERGEFIELD
Postcode } on another line. Here's my effort, with County-Country

{ IF "{ MERGEFIELD Country }" = "" "" "{ MERGEFIELD Country } " }{
MERGEFIELD
Postcode }


If Country is blank, the IF field returns blank and you get { MERGEFIELD
Postcode }. However, if Postcode is also blank then the line should be
suppressed.

If Country is non-blank you get { MERGEFIELD Country } and two spaces from
the IF field, then { MERGEFIELD Postcode }. If the Postcode is blank then
you don't actually need those two spaces but there you are.

But I didn't read the original thread so maybe there is more to it than you
have said in this one. Or maybe Graham's submission has sorted it for you.

Peter Jamieson

wrote in message
oups.com...
Peter,

Thanks for the advice. The code at present is as follows:

{ IF { MERGEFIELD Country } = "" { MERGEFIELD PostCode }
"{ MERGEFIELD
Country } { MERGEFIELD PostCode }" }

I understand what you are saying but, if, as you suggest, I put
{Mergefield Postcode} at the end, it will be OK if Potscode is blank
but if it is not, I will get Postcode twice.

I'm not sure how this solves the problem.

Best Regards
John

On 16 Mar, 13:15, "Peter Jamieson"
wrote:
How about

{ IF "{ MERGEFIELD County }" = "" "" "{ MERGEFIELD County } " }{
MERGEFIELD
Postcode }

The thing about blank line suppression is that it isn't any old blank
line
that's suppressed - it's blank lines formed from MERGEFIELD fields, but
MERGEFIELD fields nested inside some other construct such as an IF field
don't count. So only by inserting a MERGEFIELD that you know to be blank
can
you suppress the line.

More or less.

Peter Jamieson

wrote in message

oups.com...



I have two Mergefields on the same line County and PostCode.
In some cases, like sending a letter to Australia, the County field is
blank but the PostCode field contains data. In an earlier post Doug
Robbins showed me how to use If-Then-Else coding to print, one or
other or both fields but I've hit another problem.


Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank, the
line remains, so I get a blank line between "Town" and "Country".
I've tried using a second "If" statement but it makes no difference.
Could someone please advise how I can get rid of the blank line.


Best Regards
John- Hide quoted text -


- Show quoted text -





  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Another Mail Merge Problem - Word 2003

It is quite simple:
Town
If the county has content move down a line and enter the county and the
postcode (it doesn't matter of the postcode is empty here as the blank space
is at the end of the line).
If the county has no content have a look in postcode.
If postcode has content move down a line and enter the postcode
If both county and postcode are empty stay on the line with town
then move down a line and add the country.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



wrote:
Thanks Graham,

It seems very complicated but it works - I won't pretend to understand
how!

Best Regards
John

On 16 Mar, 13:33, wrote:
Peter,

Thanks for the advice. The code at present is as follows:

{ IF { MERGEFIELD Country } = "" { MERGEFIELD PostCode }
"{ MERGEFIELD
Country } { MERGEFIELD PostCode }" }

I understand what you are saying but, if, as you suggest, I put
{Mergefield Postcode} at the end, it will be OK if Potscode is blank
but if it is not, I will get Postcode twice.

I'm not sure how this solves the problem.

Best Regards
John

On 16 Mar, 13:15, "Peter Jamieson"
wrote:



How about


{ IF "{ MERGEFIELD County }" = "" "" "{ MERGEFIELD County } " }{
MERGEFIELD Postcode }


The thing about blank line suppression is that it isn't any old
blank line that's suppressed - it's blank lines formed from
MERGEFIELD fields, but MERGEFIELD fields nested inside some other
construct such as an IF field don't count. So only by inserting a
MERGEFIELD that you know to be blank can you suppress the line.


More or less.


Peter Jamieson


wrote in message


oups.com...


I have two Mergefields on the same line County and
PostCode. In some cases, like sending a letter to Australia,
the County field is blank but the PostCode field contains data.
In an earlier post Doug Robbins showed me how to use If-Then-Else
coding to print, one or other or both fields but I've hit another
problem.


Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank,
the line remains, so I get a blank line between "Town" and
"Country". I've tried using a second "If" statement but it makes
no difference. Could someone please advise how I can get rid of
the blank line.


Best Regards
John- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] john@jdraper.net is offline
external usenet poster
 
Posts: 5
Default Another Mail Merge Problem - Word 2003

Thanks to both Peter and Graham for taking the trouble to explain how
their code works. I'm really grateful to both of you for your posts
as they have solved my problem.

Best Regards
John

On 16 Mar, 14:14, "Graham Mayor" wrote:
It is quite simple:
Town
If the county has content move down a line and enter the county and the
postcode (it doesn't matter of the postcode is empty here as the blank space
is at the end of the line).
If the county has no content have a look in postcode.
If postcode has content move down a line and enter the postcode
If both county and postcode are empty stay on the line with town
then move down a line and add the country.

--

Graham Mayor - Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org




wrote:
Thanks Graham,


It seems very complicated but it works - I won't pretend to understand
how!


Best Regards
John


On 16 Mar, 13:33, wrote:
Peter,


Thanks for the advice. The code at present is as follows:


{ IF { MERGEFIELD Country } = "" { MERGEFIELD PostCode }
"{ MERGEFIELD
Country } { MERGEFIELD PostCode }" }


I understand what you are saying but, if, as you suggest, I put
{Mergefield Postcode} at the end, it will be OK if Potscode is blank
but if it is not, I will get Postcode twice.


I'm not sure how this solves the problem.


Best Regards
John


On 16 Mar, 13:15, "Peter Jamieson"
wrote:


How about


{ IF "{ MERGEFIELD County }" = "" "" "{ MERGEFIELD County } " }{
MERGEFIELD Postcode }


The thing about blank line suppression is that it isn't any old
blank line that's suppressed - it's blank lines formed from
MERGEFIELD fields, but MERGEFIELD fields nested inside some other
construct such as an IF field don't count. So only by inserting a
MERGEFIELD that you know to be blank can you suppress the line.


More or less.


Peter Jamieson


wrote in message


egroups.com...


I have two Mergefields on the same line County and
PostCode. In some cases, like sending a letter to Australia,
the County field is blank but the PostCode field contains data.
In an earlier post Doug Robbins showed me how to use If-Then-Else
coding to print, one or other or both fields but I've hit another
problem.


Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank,
the line remains, so I get a blank line between "Town" and
"Country". I've tried using a second "If" statement but it makes
no difference. Could someone please advise how I can get rid of
the blank line.


Best Regards
John- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
oli merge oli merge is offline
external usenet poster
 
Posts: 15
Default Another Mail Merge Problem - Word 2003

Hi, Im just typing here because I cant seem to make a new thread...

can someone tell me how to urgently (clicking "new" is doing nothing). I
will then delete this post

"Graham Mayor" wrote:

You need something a tad more complex eg

{ Mergefield Town }{ IF { Mergefield County } "" "¶
{ Mergefield County } { Mergefield PostCode}" "{ IF { Mergefield PostCode }
"" "¶
{ Mergefield PostCode}" ""}"}¶
{ Mergefield Country }

When compiling this press the enter key wherever you see ¶ (and nowhere
else!)

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



wrote:
I have two Mergefields on the same line County and PostCode.
In some cases, like sending a letter to Australia, the County field is
blank but the PostCode field contains data. In an earlier post Doug
Robbins showed me how to use If-Then-Else coding to print, one or
other or both fields but I've hit another problem.

Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank, the
line remains, so I get a blank line between "Town" and "Country".
I've tried using a second "If" statement but it makes no difference.
Could someone please advise how I can get rid of the blank line.

Best Regards
John




  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Another Mail Merge Problem - Word 2003

oli merge wrote:
Hi, Im just typing here because I cant seem to make a new thread...

can someone tell me how to urgently (clicking "new" is doing
nothing). I will then delete this post


You cannot delete this post! It will have already been distributed to a
variety of independent servers and will have been archived at Google.

You have either accessed the forum via one of a variety of web portals or
you have accessed the server using either your service provider's news feed
or accessed the Microsoft server directly. The latter is the simplest
option - see http://www.gmayor.com/MSNews.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



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
Word 2003 Mail Merge Problem when E-Mailing Data Source Karen Townsend Mailmerge 3 June 20th 06 08:21 AM
Mail merge filter/sort problem in Word 2003 PenguinPaul Mailmerge 0 October 25th 05 08:46 PM
Mail Merge date format problem with Word 2003 Thang New Users 1 May 2nd 05 01:55 PM
Mail Merge VBA problem in Word/Access 2003 Virgil Mailmerge 5 February 10th 05 01:23 AM
Word-Excel 2003 - Mail Merge Recipients problem AYager Mailmerge 2 January 11th 05 05:11 AM


All times are GMT +1. The time now is 08:49 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"