Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Asinger Asinger is offline
external usenet poster
 
Posts: 17
Default Using IF to add a character

I'm not sure if an IF rule is the right way to do this. I am creating a
Directory Merge, a list of names/addresses/phones/email. Some people have
more than one phone (e.g., home and cell). I would like the phones to be on
the same line, formatted as follows:

505-555-5555 / 505-555-6666

I right clicked the merge field for the second phone number shown above and
chose Edit Field. I selected the "Text to be inserted after:" check box and
entered space / space (where "space" is an actual space, not the word space).
This works great as long as there is always a value in the first phone number
field (I thought there would be but I have some records where there is only a
cell, the second phone number field, and no home phone, the first phone
number field). So instead of looking like the above example, I get this in
that case:

/ 505-555-6666

I think I need to add the spaces and slash after the first phone number
field, but I only want those characters to be used when the second phone
number field is not blank. Is that right? If so, can someone help me with
formatting the IF rule?

PART 2: What is the difference with inserting rules using the Rules
drop-down in the Ribbon versus right clicking a merge field and choosing Edit
Field? When should I use one over the other - or does it matter?

Thanks!
  #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 Using IF to add a character

Use the following field construction:

{ IF { MERGEFIELD Home } "" "{ IF { MERGEFIELD Cell } "" "{ MERGEFIELD
Home } / { MERGEFIELD Cell }" "{ MERGEFIELD Home }" }" "{ MERGEFIELD
Cell }" }

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

"Asinger" wrote in message
...
I'm not sure if an IF rule is the right way to do this. I am creating a
Directory Merge, a list of names/addresses/phones/email. Some people have
more than one phone (e.g., home and cell). I would like the phones to be
on
the same line, formatted as follows:

505-555-5555 / 505-555-6666

I right clicked the merge field for the second phone number shown above
and
chose Edit Field. I selected the "Text to be inserted after:" check box
and
entered space / space (where "space" is an actual space, not the word
space).
This works great as long as there is always a value in the first phone
number
field (I thought there would be but I have some records where there is
only a
cell, the second phone number field, and no home phone, the first phone
number field). So instead of looking like the above example, I get this in
that case:

/ 505-555-6666

I think I need to add the spaces and slash after the first phone number
field, but I only want those characters to be used when the second phone
number field is not blank. Is that right? If so, can someone help me with
formatting the IF rule?

PART 2: What is the difference with inserting rules using the Rules
drop-down in the Ribbon versus right clicking a merge field and choosing
Edit
Field? When should I use one over the other - or does it matter?

Thanks!



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Asinger Asinger is offline
external usenet poster
 
Posts: 17
Default Using IF to add a character

Doug - I understand about using Ctrl-F9 to produce the brackets. When I do
that, Word auto-inserts two spaces so that if I begin typing, my entry is
preceded and ended with a space (after/before open/close brackets). Your
entry seems to have the spaces too - can you just confirm for me that the
spaces are necessary? Also, do I type this directly in my merge document, and
where should I type it with respect to the merge fields? Thanks very much.
April

"Doug Robbins - Word MVP" wrote:

Use the following field construction:

{ IF { MERGEFIELD Home } "" "{ IF { MERGEFIELD Cell } "" "{ MERGEFIELD
Home } / { MERGEFIELD Cell }" "{ MERGEFIELD Home }" }" "{ MERGEFIELD
Cell }" }

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

"Asinger" wrote in message
...
I'm not sure if an IF rule is the right way to do this. I am creating a
Directory Merge, a list of names/addresses/phones/email. Some people have
more than one phone (e.g., home and cell). I would like the phones to be
on
the same line, formatted as follows:

505-555-5555 / 505-555-6666

I right clicked the merge field for the second phone number shown above
and
chose Edit Field. I selected the "Text to be inserted after:" check box
and
entered space / space (where "space" is an actual space, not the word
space).
This works great as long as there is always a value in the first phone
number
field (I thought there would be but I have some records where there is
only a
cell, the second phone number field, and no home phone, the first phone
number field). So instead of looking like the above example, I get this in
that case:

/ 505-555-6666

I think I need to add the spaces and slash after the first phone number
field, but I only want those characters to be used when the second phone
number field is not blank. Is that right? If so, can someone help me with
formatting the IF rule?

PART 2: What is the difference with inserting rules using the Rules
drop-down in the Ribbon versus right clicking a merge field and choosing
Edit
Field? When should I use one over the other - or does it matter?

Thanks!




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using IF to add a character

The spaces are not *required*, but as Word's insert field adds them, they
are best inserted for standardisation (e.g. you may wish to use replace on a
document so it helps if all are inserted the same way).
i.e.
{ MERGEFIELD Home }
and
{MERGEFIELD Home}
will both work equally well.

--

Graham Mayor - Word MVP

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


Asinger wrote:
Doug - I understand about using Ctrl-F9 to produce the brackets. When
I do that, Word auto-inserts two spaces so that if I begin typing, my
entry is preceded and ended with a space (after/before open/close
brackets). Your entry seems to have the spaces too - can you just
confirm for me that the spaces are necessary? Also, do I type this
directly in my merge document, and where should I type it with
respect to the merge fields? Thanks very much. April

"Doug Robbins - Word MVP" wrote:

Use the following field construction:

{ IF { MERGEFIELD Home } "" "{ IF { MERGEFIELD Cell } "" "{
MERGEFIELD Home } / { MERGEFIELD Cell }" "{ MERGEFIELD Home }" }" "{
MERGEFIELD
Cell }" }

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

"Asinger" wrote in message
...
I'm not sure if an IF rule is the right way to do this. I am
creating a Directory Merge, a list of names/addresses/phones/email.
Some people have more than one phone (e.g., home and cell). I would
like the phones to be on
the same line, formatted as follows:

505-555-5555 / 505-555-6666

I right clicked the merge field for the second phone number shown
above and
chose Edit Field. I selected the "Text to be inserted after:" check
box and
entered space / space (where "space" is an actual space, not the
word space).
This works great as long as there is always a value in the first
phone number
field (I thought there would be but I have some records where there
is only a
cell, the second phone number field, and no home phone, the first
phone number field). So instead of looking like the above example,
I get this in that case:

/ 505-555-6666

I think I need to add the spaces and slash after the first phone
number field, but I only want those characters to be used when the
second phone number field is not blank. Is that right? If so, can
someone help me with formatting the IF rule?

PART 2: What is the difference with inserting rules using the Rules
drop-down in the Ribbon versus right clicking a merge field and
choosing Edit
Field? When should I use one over the other - or does it matter?

Thanks!



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using IF to add a character

Just to add a couple of obscure details to Graham's comment
a. in the very early versions of Windows Word, Word did /not/ insert those
extra spaces automatically. I think those extra spaces arrived in Word 6.
a. there are at least two places where having a space before the closing
brace makes a difference:

{ MACROBUTTON mymacro mytext }blah
displays
mytext blah

whereas

{ MACROBUTTON mymacro mytext}blah
displays
mytextblah

and similarly

{ EQ \l(1,2,3) }blah
displays
1,2,3 blah

whereas
{ EQ \l(1,2,3)}blah
displays
1,2,3blah

There could be others, but for example SET and QUOTE fields do not behave
this way.

Peter Jamieson

"Asinger" wrote in message
...
Doug - I understand about using Ctrl-F9 to produce the brackets. When I do
that, Word auto-inserts two spaces so that if I begin typing, my entry is
preceded and ended with a space (after/before open/close brackets). Your
entry seems to have the spaces too - can you just confirm for me that the
spaces are necessary? Also, do I type this directly in my merge document,
and
where should I type it with respect to the merge fields? Thanks very much.
April

"Doug Robbins - Word MVP" wrote:

Use the following field construction:

{ IF { MERGEFIELD Home } "" "{ IF { MERGEFIELD Cell } "" "{
MERGEFIELD
Home } / { MERGEFIELD Cell }" "{ MERGEFIELD Home }" }" "{ MERGEFIELD
Cell }" }

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

"Asinger" wrote in message
...
I'm not sure if an IF rule is the right way to do this. I am creating a
Directory Merge, a list of names/addresses/phones/email. Some people
have
more than one phone (e.g., home and cell). I would like the phones to
be
on
the same line, formatted as follows:

505-555-5555 / 505-555-6666

I right clicked the merge field for the second phone number shown above
and
chose Edit Field. I selected the "Text to be inserted after:" check box
and
entered space / space (where "space" is an actual space, not the word
space).
This works great as long as there is always a value in the first phone
number
field (I thought there would be but I have some records where there is
only a
cell, the second phone number field, and no home phone, the first phone
number field). So instead of looking like the above example, I get this
in
that case:

/ 505-555-6666

I think I need to add the spaces and slash after the first phone number
field, but I only want those characters to be used when the second
phone
number field is not blank. Is that right? If so, can someone help me
with
formatting the IF rule?

PART 2: What is the difference with inserting rules using the Rules
drop-down in the Ribbon versus right clicking a merge field and
choosing
Edit
Field? When should I use one over the other - or does it matter?

Thanks!





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 replace "enter character" with "space character" in msword MS-Word Microsoft Word Help 2 May 9th 23 08:52 AM
character map michigan Microsoft Word Help 2 October 4th 06 10:18 PM
Searching for either a character or no character Larry New Users 3 July 26th 06 10:47 PM
When I type a character, the next character is deleted. Why? Amalgamalia Microsoft Word Help 1 December 8th 05 12:02 AM
chr(32) space character is a rectangular box character How to rename 2004.pst to 2005.pst Microsoft Word Help 0 February 15th 05 10:29 AM


All times are GMT +1. The time now is 12:48 AM.

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"