A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditionals in Mail Merge label layout



 
 
Thread Tools Display Modes
  #1  
Old March 16th, 2009, 01:04 AM posted to microsoft.public.word.newusers
Ed Sowell
external usenet poster
 
Posts: 13
Default Conditionals in Mail Merge label layout

I'd like to skip the Country entierly if the data is blank or USA. How is
this done?

TIA

Ed

  #2  
Old March 16th, 2009, 03:47 AM posted to microsoft.public.word.newusers
Doug Robbins - Word MVP on news.microsoft.com
external usenet poster
 
Posts: 409
Default Conditionals in Mail Merge label layout

Use the following field construction:

{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD Country } "" {
MERGEFIELD Country } "" } "" }

You must use Ctrl+F9 to insert each pair of field delimiters and you use
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, originally posted via msnews.microsoft.com

"Ed Sowell" wrote in message
...
I'd like to skip the Country entierly if the data is blank or USA. How is
this done?

TIA

Ed



  #3  
Old March 16th, 2009, 06:53 PM posted to microsoft.public.word.newusers
Ed Sowell
external usenet poster
 
Posts: 13
Default Conditionals in Mail Merge label layout

Thanks, Doug. Wierd! It would be clearer is there were explicit THEN and
ELSE.

I have a couple other questions, if you don't mind. When the Country field
is USA or empty I'd like to not have the extra empty line at the end. Is
there a way I can put a newline character in front of the Country merge
field so it is conditional?

Also, how can I specify a vertical centering within the label?

Thangs again.

Ed

"Doug Robbins - Word MVP on news.microsoft.com"
wrote in message ...
Use the following field construction:

{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD Country } "" {
MERGEFIELD Country } "" } "" }

You must use Ctrl+F9 to insert each pair of field delimiters and you use
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, originally posted via msnews.microsoft.com

"Ed Sowell" wrote in message
...
I'd like to skip the Country entierly if the data is blank or USA. How is
this done?

TIA

Ed




  #4  
Old March 17th, 2009, 07:25 AM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Conditionals in Mail Merge label layout

If you understand the syntax it is clearer

{IF condition "do this" "else do this"}

To remove the blank line put the field on the previous line and add in the
paragraph break eg

{Mergefield City}{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD
Country } "" "¶
{MERGEFIELD Country }" "" } "" }
With a paragraph break (press enter) where you see ¶

For the vertical centering. select the table and format table cell
alignment.
--

Graham Mayor - Word MVP

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





Ed Sowell wrote:
Thanks, Doug. Wierd! It would be clearer is there were explicit THEN
and ELSE.

I have a couple other questions, if you don't mind. When the Country
field is USA or empty I'd like to not have the extra empty line at
the end. Is there a way I can put a newline character in front of the
Country merge field so it is conditional?

Also, how can I specify a vertical centering within the label?

Thangs again.

Ed

"Doug Robbins - Word MVP on news.microsoft.com"
wrote in message
...
Use the following field construction:

{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD Country }
"" { MERGEFIELD Country } "" } "" }

You must use Ctrl+F9 to insert each pair of field delimiters and you
use 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, originally posted via msnews.microsoft.com

"Ed Sowell" wrote in message
...
I'd like to skip the Country entierly if the data is blank or USA.
How is this done?

TIA

Ed



  #5  
Old March 17th, 2009, 04:06 PM posted to microsoft.public.word.newusers
Ed Sowell
external usenet poster
 
Posts: 13
Default Conditionals in Mail Merge label layout

Thanks, Graham. That did it. I tried something like that, but omitted the
unmatched double quote in front of the paragraph marker. Is that the escape
sequence for embedding literals in Mail Merge? Where are all these rules
written?

Ed

"Graham Mayor" wrote in message
...
If you understand the syntax it is clearer

{IF condition "do this" "else do this"}

To remove the blank line put the field on the previous line and add in the
paragraph break eg

{Mergefield City}{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD
Country } "" "¶
{MERGEFIELD Country }" "" } "" }
With a paragraph break (press enter) where you see ¶

For the vertical centering. select the table and format table cell
alignment.
--

Graham Mayor - Word MVP

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





Ed Sowell wrote:
Thanks, Doug. Wierd! It would be clearer is there were explicit THEN
and ELSE.

I have a couple other questions, if you don't mind. When the Country
field is USA or empty I'd like to not have the extra empty line at
the end. Is there a way I can put a newline character in front of the
Country merge field so it is conditional?

Also, how can I specify a vertical centering within the label?

Thangs again.

Ed

"Doug Robbins - Word MVP on news.microsoft.com"
wrote in message
...
Use the following field construction:

{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD Country }
"" { MERGEFIELD Country } "" } "" }

You must use Ctrl+F9 to insert each pair of field delimiters and you
use 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, originally posted via msnews.microsoft.com

"Ed Sowell" wrote in message
...
I'd like to skip the Country entierly if the data is blank or USA.
How is this done?

TIA

Ed




  #6  
Old March 17th, 2009, 04:33 PM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Conditionals in Mail Merge label layout

The quote is not unmatched? It is paired with the quote after {MERGEFIELD
Country }"
You will find quite a bit (but not everything) about fields on my web site
at http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

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



Ed Sowell wrote:
Thanks, Graham. That did it. I tried something like that, but omitted
the unmatched double quote in front of the paragraph marker. Is that
the escape sequence for embedding literals in Mail Merge? Where are
all these rules written?

Ed

"Graham Mayor" wrote in message
...
If you understand the syntax it is clearer

{IF condition "do this" "else do this"}

To remove the blank line put the field on the previous line and add
in the paragraph break eg

{Mergefield City}{ IF { MERGEFIELD Country } "USA" { IF {
MERGEFIELD Country } "" "¶
{MERGEFIELD Country }" "" } "" }
With a paragraph break (press enter) where you see ¶

For the vertical centering. select the table and format table
cell alignment.
--

Graham Mayor - Word MVP

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





Ed Sowell wrote:
Thanks, Doug. Wierd! It would be clearer is there were explicit THEN
and ELSE.

I have a couple other questions, if you don't mind. When the Country
field is USA or empty I'd like to not have the extra empty line at
the end. Is there a way I can put a newline character in front of
the Country merge field so it is conditional?

Also, how can I specify a vertical centering within the label?

Thangs again.

Ed

"Doug Robbins - Word MVP on news.microsoft.com"
wrote in message
...
Use the following field construction:

{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD Country }
"" { MERGEFIELD Country } "" } "" }

You must use Ctrl+F9 to insert each pair of field delimiters and
you use 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, originally posted via msnews.microsoft.com

"Ed Sowell" wrote in message
...
I'd like to skip the Country entierly if the data is blank or USA.
How is this done?

TIA

Ed



  #7  
Old March 17th, 2009, 06:25 PM posted to microsoft.public.word.newusers
Ed Sowell
external usenet poster
 
Posts: 13
Default Conditionals in Mail Merge label layout

That's interesting. I didn't match it and it worked. I then put in the
matching one per your advice and it works too!

Ed


"Graham Mayor" wrote in message
...
The quote is not unmatched? It is paired with the quote after {MERGEFIELD
Country }"
You will find quite a bit (but not everything) about fields on my web site
at http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

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



Ed Sowell wrote:
Thanks, Graham. That did it. I tried something like that, but omitted
the unmatched double quote in front of the paragraph marker. Is that
the escape sequence for embedding literals in Mail Merge? Where are
all these rules written?

Ed

"Graham Mayor" wrote in message
...
If you understand the syntax it is clearer

{IF condition "do this" "else do this"}

To remove the blank line put the field on the previous line and add
in the paragraph break eg

{Mergefield City}{ IF { MERGEFIELD Country } "USA" { IF {
MERGEFIELD Country } "" "¶
{MERGEFIELD Country }" "" } "" }
With a paragraph break (press enter) where you see ¶

For the vertical centering. select the table and format table
cell alignment.
--

Graham Mayor - Word MVP

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





Ed Sowell wrote:
Thanks, Doug. Wierd! It would be clearer is there were explicit THEN
and ELSE.

I have a couple other questions, if you don't mind. When the Country
field is USA or empty I'd like to not have the extra empty line at
the end. Is there a way I can put a newline character in front of
the Country merge field so it is conditional?

Also, how can I specify a vertical centering within the label?

Thangs again.

Ed

"Doug Robbins - Word MVP on news.microsoft.com"
wrote in message
...
Use the following field construction:

{ IF { MERGEFIELD Country } "USA" { IF { MERGEFIELD Country }
"" { MERGEFIELD Country } "" } "" }

You must use Ctrl+F9 to insert each pair of field delimiters and
you use 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, originally posted via msnews.microsoft.com

"Ed Sowell" wrote in message
...
I'd like to skip the Country entierly if the data is blank or USA.
How is this done?

TIA

Ed




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.