Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Peter is offline
external usenet poster
 
Posts: 111
Default conditional field layouts

I'd appreciate help for setting alternate name and address layouts in a mail
merge. For example, the default layout might have these fields on 2 lines:

Suburb
City & PostCode

But if there is extra information in the full address, those fields might
need to go all on one line to meet constraints of page size, postal regs etc:

Suburb & City & PostCode

Any tips on how to do this would be appreciated.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default conditional field layouts

Broadly speaking, you can use IF fields to do some of this. For example
suppose you have two address lines, and if address2 is blank you want

address1
suburb
city postcode

but if it is non-blank you want

address1
address2
suburb, city postcode

then you can use

{ MERGEFIELD address1 }
{ IF "{ MERGEFIELD address2 }" = ""
"{ MERGEFIELD suburb }
{ MERGEFIELD city } { MERGEFIELD postcode }"
"{ MERGEFIELD address2 }
{ MERGEFIELD suburb }, { MERGEFIELD city } { MERGEFIELD postcode }" }

(or in this case

{ MERGEFIELD address1 }
{ IF "{ MERGEFIELD address2 }" = ""
"{ MERGEFIELD suburb }
" "{ MERGEFIELD address2 }
{ MERGEFIELD suburb }, " }{ MERGEFIELD city } { MERGEFIELD postcode }

etc. All the {} need to be the special "field code braces" that you can
insert using ctrl-F9.

Determining a layout based on the amount of text would be more difficult
- I don't think there's an obvious way to compare actual text width
unless you are using fixed-width fonts, but you may be able to get
character counts from your data source (depending on what it is) or do
comparisons using "wildcards" to determine character counts.

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Peter wrote:
I'd appreciate help for setting alternate name and address layouts in a mail
merge. For example, the default layout might have these fields on 2 lines:

Suburb
City & PostCode

But if there is extra information in the full address, those fields might
need to go all on one line to meet constraints of page size, postal regs etc:

Suburb & City & PostCode

Any tips on how to do this would be appreciated.

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Peter is offline
external usenet poster
 
Posts: 111
Default conditional field layouts

Thanks for the suggestions, which look quite promising. I'll try them out
and get back to you if I get stuck.

"Peter Jamieson" wrote:

Broadly speaking, you can use IF fields to do some of this. For example
suppose you have two address lines, and if address2 is blank you want

address1
suburb
city postcode

but if it is non-blank you want

address1
address2
suburb, city postcode

then you can use

{ MERGEFIELD address1 }
{ IF "{ MERGEFIELD address2 }" = ""
"{ MERGEFIELD suburb }
{ MERGEFIELD city } { MERGEFIELD postcode }"
"{ MERGEFIELD address2 }
{ MERGEFIELD suburb }, { MERGEFIELD city } { MERGEFIELD postcode }" }

(or in this case

{ MERGEFIELD address1 }
{ IF "{ MERGEFIELD address2 }" = ""
"{ MERGEFIELD suburb }
" "{ MERGEFIELD address2 }
{ MERGEFIELD suburb }, " }{ MERGEFIELD city } { MERGEFIELD postcode }

etc. All the {} need to be the special "field code braces" that you can
insert using ctrl-F9.

Determining a layout based on the amount of text would be more difficult
- I don't think there's an obvious way to compare actual text width
unless you are using fixed-width fonts, but you may be able to get
character counts from your data source (depending on what it is) or do
comparisons using "wildcards" to determine character counts.

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Peter wrote:
I'd appreciate help for setting alternate name and address layouts in a mail
merge. For example, the default layout might have these fields on 2 lines:

Suburb
City & PostCode

But if there is extra information in the full address, those fields might
need to go all on one line to meet constraints of page size, postal regs etc:

Suburb & City & PostCode

Any tips on how to do this would be appreciated.


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
Form field in conditional statement [email protected] Microsoft Word Help 4 April 28th 09 06:17 AM
HOW DO I SET UP A CONDITIONAL FORMAT TO A FIELD DOUG GARDNER Mailmerge 1 October 20th 08 12:28 AM
Conditional Wordart via Mailmerge-Field? Lüko Willms Mailmerge 3 October 13th 06 04:57 AM
Conditional page numbering field in header Island Girl New Users 3 July 6th 06 05:40 PM
Conditional merging a field and formating it [email protected] Mailmerge 1 April 7th 06 08:02 PM


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