#1   Report Post  
Posted to microsoft.public.word.docmanagement
Paul J Paul J is offline
external usenet poster
 
Posts: 6
Default IF statement

I'm trying to apply an IF statement to a mailmerge field in a document. The
field in question is a 'Name' and is stored in the database as, for example,
'Paul_Jacques'. What I want to do is strip out the underscore and replace it
with a SPACE. I've tried the following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only ever
prints "Paul Jacques" regardless of the relevant name. What have I done wrong?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default IF statement

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is the
record content of those fields that matters.
Or do you really have a field called 'Name' which contains these underscored
names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF { Mergefield
Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield Name } =
"Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }" }" }" } would
probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What have
I done wrong?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Paul J Paul J is offline
external usenet poster
 
Posts: 6
Default IF statement

Hi Graham,

Yes the info is coming from a mergefield. I did originally start with a
variation of what you have provided. Sorry my description was a little
unclear. I'll give your example a try.

Thanks

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is the
record content of those fields that matters.
Or do you really have a field called 'Name' which contains these underscored
names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF { Mergefield
Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield Name } =
"Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }" }" }" } would
probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What have
I done wrong?




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Paul J Paul J is offline
external usenet poster
 
Posts: 6
Default IF statement

Hi,

I've tried what you suggested but unfortunately, the field isn't big enough
to enter all of the statement. Is there anyway of abbreviating this or is
there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field', selecting
'If' from the 'Field names' list and then entering the statement in the
'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is the
record content of those fields that matters.
Or do you really have a field called 'Name' which contains these underscored
names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF { Mergefield
Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield Name } =
"Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }" }" }" } would
probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What have
I done wrong?




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default IF statement

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?





  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Paul J Paul J is offline
external usenet poster
 
Posts: 6
Default IF statement

Hi Graham,

Thanks once again. I'll see how I get on

"Graham Mayor" wrote:

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?




  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Ed Ed is offline
external usenet poster
 
Posts: 217
Default IF statement


Hi Paul,

As Graham suggests, you need to ensure that you get the curly brackets and
the quotes in the right places when you're creating your fields and this can
be quite tricky if you build up the fields in the "natural" left-to-right
way. For an alternative way to construct some types of nested IF fields which
I find to be easier to get right, check out the first parts of this thread:

http://groups.google.co.uk/group/mic...1a841b aa79cb

I won't duplicate the content here as I was just a tab verbose when I wrote
my part:-)

Regards.

Ed
"Paul J" wrote:

Hi Graham,

Thanks once again. I'll see how I get on

"Graham Mayor" wrote:

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?




  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Ed Ed is offline
external usenet poster
 
Posts: 217
Default IF statement

Hi Ed,

"a tab verbose"??? Surely you meant "tad"!

Yes, Ed, I did. I spotted it a microsecond after I pressed the Post button.
Always the way Thanks for pointing it out.

I'm welcome.

Regards.

Ed
"Ed" wrote:


Hi Paul,

As Graham suggests, you need to ensure that you get the curly brackets and
the quotes in the right places when you're creating your fields and this can
be quite tricky if you build up the fields in the "natural" left-to-right
way. For an alternative way to construct some types of nested IF fields which
I find to be easier to get right, check out the first parts of this thread:

http://groups.google.co.uk/group/mic...1a841b aa79cb

I won't duplicate the content here as I was just a tab verbose when I wrote
my part:-)

Regards.

Ed
"Paul J" wrote:

Hi Graham,

Thanks once again. I'll see how I get on

"Graham Mayor" wrote:

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?



  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Paul J Paul J is offline
external usenet poster
 
Posts: 6
Default IF statement

Hi Ed,

Many thanks for that. I have checked the thread and tried the following.
However, all that prints out is 'Mergefield'. I'm obviously still going wrong
somewhe

{ if { Mergefield UserResponseAssignedTo } = "Orla_Byrne" "Orla Byrne" "{ IF
{Mergefield UserResponseAssignedTo } = "Brenda Corrigan" "Brenda Corrigan" "{
IF { Mergefield UserResponseAssignedTo } = "Ingrid_Dempsey" "Ingrid Dempsey"
"{ IF { Mergefield UserResponseAssignedTo } = "Laura_O'Carroll" "Laura
O'Carroll" "{ Mergefield UserResponseAssignedTo}" }" }" }" }

Thanks

Paul

"Ed" wrote:

Hi Ed,

"a tab verbose"??? Surely you meant "tad"!

Yes, Ed, I did. I spotted it a microsecond after I pressed the Post button.
Always the way Thanks for pointing it out.

I'm welcome.

Regards.

Ed
"Ed" wrote:


Hi Paul,

As Graham suggests, you need to ensure that you get the curly brackets and
the quotes in the right places when you're creating your fields and this can
be quite tricky if you build up the fields in the "natural" left-to-right
way. For an alternative way to construct some types of nested IF fields which
I find to be easier to get right, check out the first parts of this thread:

http://groups.google.co.uk/group/mic...1a841b aa79cb

I won't duplicate the content here as I was just a tab verbose when I wrote
my part:-)

Regards.

Ed
"Paul J" wrote:

Hi Graham,

Thanks once again. I'll see how I get on

"Graham Mayor" wrote:

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?



  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Ed Ed is offline
external usenet poster
 
Posts: 217
Default IF statement

Hi Paul,

To me the structure looks OK. Any chance you've used the curly brackets on
the keyboard to insert some of the field braces? When you create fields
manually you need to use CTRL+F9.

There are a couple of ways to tell. By default at least, the "true" field
braces look bolder than ordinary curly brackets. Also, try selecting each
field brace in turn and see what shows as selected.

My guess would be the final { Mergefield UserResponseAssignedTo}.

Regards.

Ed

"Paul J" wrote:

Hi Ed,

Many thanks for that. I have checked the thread and tried the following.
However, all that prints out is 'Mergefield'. I'm obviously still going wrong
somewhe

{ if { Mergefield UserResponseAssignedTo } = "Orla_Byrne" "Orla Byrne" "{ IF
{Mergefield UserResponseAssignedTo } = "Brenda Corrigan" "Brenda Corrigan" "{
IF { Mergefield UserResponseAssignedTo } = "Ingrid_Dempsey" "Ingrid Dempsey"
"{ IF { Mergefield UserResponseAssignedTo } = "Laura_O'Carroll" "Laura
O'Carroll" "{ Mergefield UserResponseAssignedTo}" }" }" }" }

Thanks

Paul

"Ed" wrote:

Hi Ed,

"a tab verbose"??? Surely you meant "tad"!

Yes, Ed, I did. I spotted it a microsecond after I pressed the Post button.
Always the way Thanks for pointing it out.

I'm welcome.

Regards.

Ed
"Ed" wrote:


Hi Paul,

As Graham suggests, you need to ensure that you get the curly brackets and
the quotes in the right places when you're creating your fields and this can
be quite tricky if you build up the fields in the "natural" left-to-right
way. For an alternative way to construct some types of nested IF fields which
I find to be easier to get right, check out the first parts of this thread:

http://groups.google.co.uk/group/mic...1a841b aa79cb

I won't duplicate the content here as I was just a tab verbose when I wrote
my part:-)

Regards.

Ed
"Paul J" wrote:

Hi Graham,

Thanks once again. I'll see how I get on

"Graham Mayor" wrote:

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?





  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Paul J Paul J is offline
external usenet poster
 
Posts: 6
Default IF statement

Hi Ed,

Thats exactly what it was. Many thanks for all your help.

Paul

"Ed" wrote:

Hi Paul,

To me the structure looks OK. Any chance you've used the curly brackets on
the keyboard to insert some of the field braces? When you create fields
manually you need to use CTRL+F9.

There are a couple of ways to tell. By default at least, the "true" field
braces look bolder than ordinary curly brackets. Also, try selecting each
field brace in turn and see what shows as selected.

My guess would be the final { Mergefield UserResponseAssignedTo}.

Regards.

Ed

"Paul J" wrote:

Hi Ed,

Many thanks for that. I have checked the thread and tried the following.
However, all that prints out is 'Mergefield'. I'm obviously still going wrong
somewhe

{ if { Mergefield UserResponseAssignedTo } = "Orla_Byrne" "Orla Byrne" "{ IF
{Mergefield UserResponseAssignedTo } = "Brenda Corrigan" "Brenda Corrigan" "{
IF { Mergefield UserResponseAssignedTo } = "Ingrid_Dempsey" "Ingrid Dempsey"
"{ IF { Mergefield UserResponseAssignedTo } = "Laura_O'Carroll" "Laura
O'Carroll" "{ Mergefield UserResponseAssignedTo}" }" }" }" }

Thanks

Paul

"Ed" wrote:

Hi Ed,

"a tab verbose"??? Surely you meant "tad"!

Yes, Ed, I did. I spotted it a microsecond after I pressed the Post button.
Always the way Thanks for pointing it out.

I'm welcome.

Regards.

Ed
"Ed" wrote:


Hi Paul,

As Graham suggests, you need to ensure that you get the curly brackets and
the quotes in the right places when you're creating your fields and this can
be quite tricky if you build up the fields in the "natural" left-to-right
way. For an alternative way to construct some types of nested IF fields which
I find to be easier to get right, check out the first parts of this thread:

http://groups.google.co.uk/group/mic...1a841b aa79cb

I won't duplicate the content here as I was just a tab verbose when I wrote
my part:-)

Regards.

Ed
"Paul J" wrote:

Hi Graham,

Thanks once again. I'll see how I get on

"Graham Mayor" wrote:

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?



  #12   Report Post  
Posted to microsoft.public.word.docmanagement
Ed Ed is offline
external usenet poster
 
Posts: 217
Default IF statement

You're welcome.

Regards.

Ed

"Paul J" wrote:

Hi Ed,

Thats exactly what it was. Many thanks for all your help.

Paul

"Ed" wrote:

Hi Paul,

To me the structure looks OK. Any chance you've used the curly brackets on
the keyboard to insert some of the field braces? When you create fields
manually you need to use CTRL+F9.

There are a couple of ways to tell. By default at least, the "true" field
braces look bolder than ordinary curly brackets. Also, try selecting each
field brace in turn and see what shows as selected.

My guess would be the final { Mergefield UserResponseAssignedTo}.

Regards.

Ed

"Paul J" wrote:

Hi Ed,

Many thanks for that. I have checked the thread and tried the following.
However, all that prints out is 'Mergefield'. I'm obviously still going wrong
somewhe

{ if { Mergefield UserResponseAssignedTo } = "Orla_Byrne" "Orla Byrne" "{ IF
{Mergefield UserResponseAssignedTo } = "Brenda Corrigan" "Brenda Corrigan" "{
IF { Mergefield UserResponseAssignedTo } = "Ingrid_Dempsey" "Ingrid Dempsey"
"{ IF { Mergefield UserResponseAssignedTo } = "Laura_O'Carroll" "Laura
O'Carroll" "{ Mergefield UserResponseAssignedTo}" }" }" }" }

Thanks

Paul

"Ed" wrote:

Hi Ed,

"a tab verbose"??? Surely you meant "tad"!

Yes, Ed, I did. I spotted it a microsecond after I pressed the Post button.
Always the way Thanks for pointing it out.

I'm welcome.

Regards.

Ed
"Ed" wrote:


Hi Paul,

As Graham suggests, you need to ensure that you get the curly brackets and
the quotes in the right places when you're creating your fields and this can
be quite tricky if you build up the fields in the "natural" left-to-right
way. For an alternative way to construct some types of nested IF fields which
I find to be easier to get right, check out the first parts of this thread:

http://groups.google.co.uk/group/mic...1a841b aa79cb

I won't duplicate the content here as I was just a tab verbose when I wrote
my part:-)

Regards.

Ed
"Paul J" wrote:

Hi Graham,

Thanks once again. I'll see how I get on

"Graham Mayor" wrote:

You cannot enter a nested field of this complexity using the field tool.
You will have to enter from the keyboard using CTRL+F9 for each field
bracket pair.
Nake sure you get the brackets and the quotes in the right places or it
won't work - and don't do as I did originally and spell Mergefield
incorrectly

--

Graham Mayor - Word MVP

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


Paul J wrote:
Hi,

I've tried what you suggested but unfortunately, the field isn't big
enough to enter all of the statement. Is there anyway of abbreviating
this or is there somewhere else I can enter it?

Currently, I'm right-clicking the mergefield, then 'Edit Field',
selecting 'If' from the 'Field names' list and then entering the
statement in the 'Field Codes:' prompt.

"Graham Mayor" wrote:

This sounds a tad bizarre unless you have not explained it well.
What difference does it make what the fieldnames are called? It is
the record content of those fields that matters.
Or do you really have a field called 'Name' which contains these
underscored names? In which case
{ IF { Mergefield Name } = "Paul_Jaques" "Paul Jaques" "{ IF {
Mergefield Name } = "Nick_Hunter" "Nick Hunter" "{ IF { Mergefield
Name } = "Anthony_Robinson" "Anthony Robinson" "{ Merfefield Name }"
}" }" } would probably be nearer the mark?

--

Graham Mayor - Word MVP

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



Paul J wrote:
I'm trying to apply an IF statement to a mailmerge field in a
document. The field in question is a 'Name' and is stored in the
database as, for example, 'Paul_Jacques'. What I want to do is strip
out the underscore and replace it with a SPACE. I've tried the
following:

IF "Paul_Jacques" "Paul Jacques" IF "Nick_Hunter" "Nick Hunter" IF
"Anthony_Robinson" "Anthony Robinson"

Although it seems to accept the entry, on the print itself it only
ever prints "Paul Jacques" regardless of the relevant name. What
have I done wrong?



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
Using an If Statement Kelly Mailmerge 6 September 28th 07 07:31 PM
which statement right , question is Choose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 16th 06 11:15 AM
which statement right , question isChoose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 15th 06 11:20 PM
using iif statement Boots Mailmerge 3 June 19th 06 03:23 PM
How can I? If statement ? Buttercup Mailmerge 2 November 23rd 05 06:49 PM


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