Help!

conditional field layouts

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> MailMerge Fields RSS
Next:  cid:X.MA1.1251316119@aol.com  
Author Message
Peter
External


Since: Mar 07, 2006
Posts: 207



PostPosted: Wed Sep 09, 2009 11:54 am    Post subject: conditional field layouts
Archived from groups: microsoft>public>word>mailmerge>fields (more info?)

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.
Back to top
Peter Jamieson
External


Since: Jan 15, 2009
Posts: 94



PostPosted: Wed Sep 09, 2009 7:10 pm    Post subject: Re: conditional field layouts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.
Back to top
Peter
External


Since: Mar 07, 2006
Posts: 207



PostPosted: Sun Sep 13, 2009 8:15 pm    Post subject: Re: conditional field layouts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> MailMerge Fields All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum