Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
bxgti4x4 bxgti4x4 is offline
external usenet poster
 
Posts: 4
Default If -Then-Else Statements in Word 2003

I have been reading all the posts regarding the use of Word Fields to
skip a field if the data is blank but I'm still having problems.

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 but when I merge the data,
the whole line is blanked out.

I have tried using the If-Then-Else statement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.

What I want to say is - [If County = "" show Post Code else County and
PostCode]

Could someone please advise how I should format this line and make it
stay there.

Thanks and Regards
John

  #2   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 If -Then-Else Statements in Word 2003

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

You must use Ctrl+F9 to insert each pair of field delimiters and Alt+F9 to
toggle off their display.

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

"bxgti4x4" wrote in message
ups.com...
I have been reading all the posts regarding the use of Word Fields to
skip a field if the data is blank but I'm still having problems.

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 but when I merge the data,
the whole line is blanked out.

I have tried using the If-Then-Else statement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.

What I want to say is - [If County = "" show Post Code else County and
PostCode]

Could someone please advise how I should format this line and make it
stay there.

Thanks and Regards
John



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default If -Then-Else Statements in Word 2003

{IF{Mergefield County} = "" "{Mergefield PostCode}" "{Mergefield County}
{Mergefield PostCode}"}

Each pair of field boundaries {} is inserted with CTRL+F9. Type the rest.
ALT+F9 to toggle the display.

--

Graham Mayor - Word MVP

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


bxgti4x4 wrote:
I have been reading all the posts regarding the use of Word Fields to
skip a field if the data is blank but I'm still having problems.

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 but when I merge the data,
the whole line is blanked out.

I have tried using the If-Then-Else statement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.

What I want to say is - [If County = "" show Post Code else County and
PostCode]

Could someone please advise how I should format this line and make it
stay there.

Thanks and Regards
John



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
bxgti4x4 bxgti4x4 is offline
external usenet poster
 
Posts: 4
Default If -Then-Else Statements in Word 2003

Thanks Graham and Doug,

That did the trick, I think I was not closing the entry with Alt F9

Thanks for your help.

Best Regards
John

On Mar 1, 3:25 pm, "Graham Mayor" wrote:
{IF{Mergefield County} = "" "{Mergefield PostCode}" "{Mergefield County}
{Mergefield PostCode}"}

Each pair of field boundaries {} is inserted with CTRL+F9. Type the rest.
ALT+F9 to toggle the display.

--

Graham Mayor - Word MVP

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




bxgti4x4 wrote:
I have been reading all the posts regarding the use of Word Fields to
skip a field if the data is blank but I'm still having problems.


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 but when I merge the data,
the whole line is blanked out.


I have tried using the If-Then-Else statement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.


What I want to say is - [If County = "" show Post Code else County and
PostCode]


Could someone please advise how I should format this line and make it
stay there.


Thanks and Regards
John- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
bxgti4x4 bxgti4x4 is offline
external usenet poster
 
Posts: 4
Default If -Then-Else Statements in Word 2003

Hello Again,

I have been woking on the field but am finding the following problems:

1 No matter what I do, I end up with a space before the text is
printed. How do I get rid of this?
2 I wish to put two spaces between County and PostCode but, again,
no matter how many spaces I enter into the code, I still end up with
only one between the two parts of the text. How do I space the two
part out?

So near and yet so far!

Best Regards
John

On Mar 1, 4:36 pm, "bxgti4x4" wrote:
Thanks Graham and Doug,

That did the trick, I think I was not closing the entry with Alt F9

Thanks for your help.

Best Regards
John

On Mar 1, 3:25 pm, "Graham Mayor" wrote:



{IF{Mergefield County} = "" "{Mergefield PostCode}" "{Mergefield County}
{Mergefield PostCode}"}


Each pair of field boundaries {} is inserted with CTRL+F9. Type the rest.
ALT+F9 to toggle the display.


--

Graham Mayor - Word MVP


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


bxgti4x4 wrote:
I have been reading all the posts regarding the use of Word Fields to
skip a field if the data is blank but I'm still having problems.


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 but when I merge the data,
the whole line is blanked out.


I have tried using the If-Then-Else statement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.


What I want to say is - [If County = "" show Post Code else County and
PostCode]


Could someone please advise how I should format this line and make it
stay there.


Thanks and Regards
John- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





  #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 If -Then-Else Statements in Word 2003

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

If you have two spaces in place of the [ ] above, that is what you will
get.

You should not have { MERGEFIELD Country } anywhere else in the document
except where it appears in the above construction.
--
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

"bxgti4x4" wrote in message
ups.com...
Hello Again,

I have been woking on the field but am finding the following problems:

1 No matter what I do, I end up with a space before the text is
printed. How do I get rid of this?
2 I wish to put two spaces between County and PostCode but, again,
no matter how many spaces I enter into the code, I still end up with
only one between the two parts of the text. How do I space the two
part out?

So near and yet so far!

Best Regards
John

On Mar 1, 4:36 pm, "bxgti4x4" wrote:
Thanks Graham and Doug,

That did the trick, I think I was not closing the entry with Alt F9

Thanks for your help.

Best Regards
John

On Mar 1, 3:25 pm, "Graham Mayor" wrote:



{IF{Mergefield County} = "" "{Mergefield PostCode}" "{Mergefield
County}
{Mergefield PostCode}"}


Each pair of field boundaries {} is inserted with CTRL+F9. Type the
rest.
ALT+F9 to toggle the display.


--

Graham Mayor - Word MVP


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


bxgti4x4 wrote:
I have been reading all the posts regarding the use of Word Fields to
skip a field if the data is blank but I'm still having problems.


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 but when I merge the
data,
the whole line is blanked out.


I have tried using the If-Then-Else statement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.


What I want to say is - [If County = "" show Post Code else County
and
PostCode]


Could someone please advise how I should format this line and make it
stay there.


Thanks and Regards
John- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
bxgti4x4 bxgti4x4 is offline
external usenet poster
 
Posts: 4
Default If -Then-Else Statements in Word 2003

Thanks Doug, that worked OK. It was odd, I tried it before and it
didn't work - hence my previous post. Not sure what changed but all
is well.

Thanks very much for your help.

Best Regards
John

On Mar 1, 9:25 pm, "Doug Robbins - Word MVP"
wrote:
{ IF { MERGEFIELD Country } = "" { MERGEFIELD PostCode } "{ MERGEFIELD
Country }[ ]{ MERGEFIELD PostCode }" }

If you have two spaces in place of the [ ] above, that is what you will
get.

You should not have { MERGEFIELD Country } anywhere else in the document
except where it appears in the above construction.
--
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

"bxgti4x4" wrote in message

ups.com...



Hello Again,


I have been woking on the field but am finding the following problems:


1 No matter what I do, I end up with a space before the text is
printed. How do I get rid of this?
2 I wish to put two spaces between County and PostCode but, again,
no matter how many spaces I enter into the code, I still end up with
only one between the two parts of the text. How do I space the two
part out?


So near and yet so far!


Best Regards
John


On Mar 1, 4:36 pm, "bxgti4x4" wrote:
Thanks Graham and Doug,


That did the trick, I think I was not closing the entry with Alt F9


Thanks for your help.


Best Regards
John


On Mar 1, 3:25 pm, "Graham Mayor" wrote:


{IF{Mergefield County} = "" "{Mergefield PostCode}" "{Mergefield
County}
{Mergefield PostCode}"}


Each pair of field boundaries {} is inserted with CTRL+F9. Type the
rest.
ALT+F9 to toggle the display.


--

Graham Mayor - Word MVP


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


bxgti4x4 wrote:
I have been reading all the posts regarding the use of Word Fields to
skip a field if the data is blank but I'm still having problems.


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 but when I merge the
data,
the whole line is blanked out.


I have tried using the If-Then-Else statement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.


What I want to say is - [If County = "" show Post Code else County
and
PostCode]


Could someone please advise how I should format this line and make it
stay there.


Thanks and Regards
John- Hide quoted text -


- Show quoted text -- 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 If -Then-Else Statements in Word 2003

On Mar 2, 9:37 am, "bxgti4x4" wrote:
Thanks Doug, that worked OK. It was odd, I tried it before and it
didn't work - hence my previous post. Not sure what changed but all
is well.

Thanks very much for your help.

Best Regards
John

On Mar 1, 9:25 pm, "Doug Robbins -WordMVP"
wrote:



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


If you have two spaces in place of the [ ] above, that is what you will
get.


You should not have { MERGEFIELD Country } anywhere else in the document
except where it appears in the above construction.
--
Hope this helps.


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


Doug Robbins -WordMVP


"bxgti4x4" wrote in message


oups.com...


Hello Again,


I have been woking on the field but am finding the following problems:


1 No matter what I do, I end up with a space before the text is
printed. How do I get rid of this?
2 I wish to put two spaces between County and PostCode but, again,
no matter how many spaces I enter into the code, I still end up with
only one between the two parts of the text. How do I space the two
part out?


So near and yet so far!


Best Regards
John


On Mar 1, 4:36 pm, "bxgti4x4" wrote:
Thanks Graham and Doug,


That did the trick, I think I was not closing the entry with Alt F9


Thanks for your help.


Best Regards
John


On Mar 1, 3:25 pm, "Graham Mayor" wrote:


{IF{Mergefield County} = "" "{Mergefield PostCode}" "{Mergefield
County}
{Mergefield PostCode}"}


Each pair of field boundaries {} is inserted with CTRL+F9. Type the
rest.
ALT+F9 to toggle the display.


--

Graham Mayor - WordMVP


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


bxgti4x4 wrote:
I have been reading all the posts regarding the use ofWordFields to
skip a field if the data is blank but I'm still having problems.


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 but when I merge the
data,
the whole line is blanked out.


I have tried using theIf-Then-Elsestatement as advised in various
posts but I cannot save the revised field. AlI I end up with is the
original mergefield.


What I want to say is - [If County = "" show Post Code else County
and
PostCode]

I've hit another problem with this code.

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.

Thanks a lot
John

Could someone please advise how I should format this line and make it
stay there.


Thanks and Regards
John- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



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
how to create cells in table using if statements in word DMAX Mailmerge 1 December 6th 06 07:55 PM
Nested If statements in MS Word 2003 - Help! crun Mailmerge 1 April 12th 06 08:10 AM
How do i use multiple IF statements in word 2000? dg Mailmerge 1 August 18th 05 06:24 AM
Word 2K: Conditional statements (if...then...else) in Merge files leftnotracks Mailmerge 0 June 16th 05 10:18 PM
Mail Merge If Statements (Word 02) Tab Mailmerge 1 March 4th 05 08:01 AM


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