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 » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

mail merge if statement



 
 
Thread Tools Display Modes
  #1  
Old October 9th, 2007, 06:44 AM posted to microsoft.public.word.mailmerge.fields
kyle''s
external usenet poster
 
Posts: 11
Default mail merge if statement

is it possible to create an if statement to change the format of a phone
number.

we have in our database client phone numbers eg 07 5555 5555, can I create
an if statement to have the number displate as +61 7 5555 5555, or am I
asking too much?

Any help would be much appreciated.
  #2  
Old October 9th, 2007, 08:53 AM posted to microsoft.public.word.mailmerge.fields
Graham Mayor
external usenet poster
 
Posts: 18,297
Default mail merge if statement

It rather depends on what the phone number field produces in Word during a
merge

If it produces the number 0755555555 then what you ask is fairly
straightforward, if it doesn't it would be worth amending the data to
achieve that. If you only have the one country code to consider then you
don't need a conditional field, you need a field switch and the +61 ewntered
as text before it.

+61 { Mergefield Phone \# "0' '0000' '0000" }

If you just want to add the switch to some of your numbers based on country
then

{ IF { Mergefield Country } = "Cocos-Keeling Islands" "+61 { Mergefield
Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00' '0000' '0000" }" }

should do the trick.

You could even add a country code to your data source and then merge the two
fields eg

IF {Mergefield Country} "Name of your country" "{Mergefield CountryCode}
{ Mergefield Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00' '0000'
'0000" }" }

Where "Name of your country" is the actual country name from your data
source.


--

Graham Mayor - Word MVP

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



kyle''s wrote:
is it possible to create an if statement to change the format of a
phone number.

we have in our database client phone numbers eg 07 5555 5555, can I
create an if statement to have the number displate as +61 7 5555
5555, or am I asking too much?

Any help would be much appreciated.



  #3  
Old October 10th, 2007, 12:17 AM posted to microsoft.public.word.mailmerge.fields
kyle''s
external usenet poster
 
Posts: 11
Default mail merge if statement

Thank you Graham! You are a life saver!

"Graham Mayor" wrote:

It rather depends on what the phone number field produces in Word during a
merge

If it produces the number 0755555555 then what you ask is fairly
straightforward, if it doesn't it would be worth amending the data to
achieve that. If you only have the one country code to consider then you
don't need a conditional field, you need a field switch and the +61 ewntered
as text before it.

+61 { Mergefield Phone \# "0' '0000' '0000" }

If you just want to add the switch to some of your numbers based on country
then

{ IF { Mergefield Country } = "Cocos-Keeling Islands" "+61 { Mergefield
Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00' '0000' '0000" }" }

should do the trick.

You could even add a country code to your data source and then merge the two
fields eg

IF {Mergefield Country} "Name of your country" "{Mergefield CountryCode}
{ Mergefield Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00' '0000'
'0000" }" }

Where "Name of your country" is the actual country name from your data
source.


--

Graham Mayor - Word MVP

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



kyle''s wrote:
is it possible to create an if statement to change the format of a
phone number.

we have in our database client phone numbers eg 07 5555 5555, can I
create an if statement to have the number displate as +61 7 5555
5555, or am I asking too much?

Any help would be much appreciated.




  #4  
Old October 10th, 2007, 03:23 AM posted to microsoft.public.word.mailmerge.fields
kyle''s
external usenet poster
 
Posts: 11
Default mail merge if statement

Hi Graham,

thanks for you quick response! I have another questions for you (lucky
you). lol

The way all of our users enter the phone number into our database system is
07 5555 5555 or (07) 5555 5555. The country code is ok cause we will only be
using the one eg. +61. Is there a way of the phone number being displayed as

{ Mergefield Phone \# "0' '0000' '0000" }

without having to amend all our records in our database to 0755555555?

many thanks.



"Graham Mayor" wrote:

It rather depends on what the phone number field produces in Word during a
merge

If it produces the number 0755555555 then what you ask is fairly
straightforward, if it doesn't it would be worth amending the data to
achieve that. If you only have the one country code to consider then you
don't need a conditional field, you need a field switch and the +61 ewntered
as text before it.

+61 { Mergefield Phone \# "0' '0000' '0000" }

If you just want to add the switch to some of your numbers based on country
then

{ IF { Mergefield Country } = "Cocos-Keeling Islands" "+61 { Mergefield
Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00' '0000' '0000" }" }

should do the trick.

You could even add a country code to your data source and then merge the two
fields eg

IF {Mergefield Country} "Name of your country" "{Mergefield CountryCode}
{ Mergefield Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00' '0000'
'0000" }" }

Where "Name of your country" is the actual country name from your data
source.


--

Graham Mayor - Word MVP

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



kyle''s wrote:
is it possible to create an if statement to change the format of a
phone number.

we have in our database client phone numbers eg 07 5555 5555, can I
create an if statement to have the number displate as +61 7 5555
5555, or am I asking too much?

Any help would be much appreciated.




  #5  
Old October 10th, 2007, 08:38 AM posted to microsoft.public.word.mailmerge.fields
Graham Mayor
external usenet poster
 
Posts: 18,297
Default mail merge if statement

Unfortunately you cannot use number switches on text fields and there is no
way to extract part of a text field using fields. You need to change the
type of data source field to a number field. How readily this can be
achieved would be determined by your data application.

--

Graham Mayor - Word MVP

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


kyle''s wrote:
Hi Graham,

thanks for you quick response! I have another questions for you
(lucky you). lol

The way all of our users enter the phone number into our database
system is 07 5555 5555 or (07) 5555 5555. The country code is ok
cause we will only be using the one eg. +61. Is there a way of the
phone number being displayed as

{ Mergefield Phone \# "0' '0000' '0000" }

without having to amend all our records in our database to 0755555555?

many thanks.



"Graham Mayor" wrote:

It rather depends on what the phone number field produces in Word
during a merge

If it produces the number 0755555555 then what you ask is fairly
straightforward, if it doesn't it would be worth amending the data to
achieve that. If you only have the one country code to consider then
you don't need a conditional field, you need a field switch and the
+61 ewntered as text before it.

+61 { Mergefield Phone \# "0' '0000' '0000" }

If you just want to add the switch to some of your numbers based on
country then

{ IF { Mergefield Country } = "Cocos-Keeling Islands" "+61 {
Mergefield Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00'
'0000' '0000" }" }

should do the trick.

You could even add a country code to your data source and then merge
the two fields eg

IF {Mergefield Country} "Name of your country" "{Mergefield
CountryCode} { Mergefield Phone \# "0' '0000' '0000" }" "{Mergefield
Phone \# "00' '0000' '0000" }" }

Where "Name of your country" is the actual country name from your
data source.


--

Graham Mayor - Word MVP

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



kyle''s wrote:
is it possible to create an if statement to change the format of a
phone number.

we have in our database client phone numbers eg 07 5555 5555, can I
create an if statement to have the number displate as +61 7 5555
5555, or am I asking too much?

Any help would be much appreciated.



  #6  
Old October 10th, 2007, 09:05 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default mail merge if statement

Which database are you using? Which version of Word?

--
Peter Jamieson
http://tips.pjmsn.me.uk

"kyle''s" wrote in message
...
Hi Graham,

thanks for you quick response! I have another questions for you (lucky
you). lol

The way all of our users enter the phone number into our database system
is
07 5555 5555 or (07) 5555 5555. The country code is ok cause we will only
be
using the one eg. +61. Is there a way of the phone number being displayed
as

{ Mergefield Phone \# "0' '0000' '0000" }

without having to amend all our records in our database to 0755555555?

many thanks.



"Graham Mayor" wrote:

It rather depends on what the phone number field produces in Word during
a
merge

If it produces the number 0755555555 then what you ask is fairly
straightforward, if it doesn't it would be worth amending the data to
achieve that. If you only have the one country code to consider then you
don't need a conditional field, you need a field switch and the +61
ewntered
as text before it.

+61 { Mergefield Phone \# "0' '0000' '0000" }

If you just want to add the switch to some of your numbers based on
country
then

{ IF { Mergefield Country } = "Cocos-Keeling Islands" "+61 { Mergefield
Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00' '0000'
'0000" }" }

should do the trick.

You could even add a country code to your data source and then merge the
two
fields eg

IF {Mergefield Country} "Name of your country" "{Mergefield
CountryCode}
{ Mergefield Phone \# "0' '0000' '0000" }" "{Mergefield Phone \# "00'
'0000'
'0000" }" }

Where "Name of your country" is the actual country name from your data
source.


--

Graham Mayor - Word MVP

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



kyle''s wrote:
is it possible to create an if statement to change the format of a
phone number.

we have in our database client phone numbers eg 07 5555 5555, can I
create an if statement to have the number displate as +61 7 5555
5555, or am I asking too much?

Any help would be much appreciated.





 




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 09:57 PM.


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