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  

Mailmerge Help



 
 
Thread Tools Display Modes
  #11  
Old August 17th, 2008, 09:43 PM posted to microsoft.public.word.mailmerge.fields
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Mailmerge Help

Hi Fred,

If you use the coding version without the enclosing QUOTE field, you'll get syntax errors until the merge is run. That's because the
second field needs the bookmark from the first field, which won't have been set yet. Wrapping both fields in a QUOTE field ensures
they'r updated together.

--
Cheers
macropod
[MVP - Microsoft Word]


"Fred" wrote in message ...
This is what got returned:

!Syntax Error, +

{=+0}

"Graham Mayor" wrote:

Indeed! I wasn't doubting you

--

Graham Mayor - Word MVP

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



macropod wrote:
Hi Graham,

This approach is certainly more compact than using IF tests. My first
post in this thread shows how one could process many nuls without
resorting to a miriad of IF tests, and keeping the ultimate formula
intelligible.

"Graham Mayor" wrote in message
...
On a simple level I meant a level that the OP may understand It
was said that only b might be empty, but it would be easy enough to
process a in the same way. I do like your second version --

Graham Mayor - Word MVP

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



macropod wrote:
Hi Graham,

What if Mergefield 'a' can return nul also? The field code I posted
deals with both scenarios. To deal with just 'b', one could also
use: {QUOTE{SET b {MERGEFIELD b}}{={MERGEFIELD a}+b \# 0}}
or even:
{SET b {MERGEFIELD b}}{={MERGEFIELD a}+b \# 0}
which is simpler still!


"Graham Mayor" wrote in message
...
On a more simple level you could just use a conditional field eg

{={Mergefield a} + {IF {Mergefield b} = "" "0" "{Mergefield b}"}}


--

Graham Mayor - Word MVP

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




Fred wrote:
I have a program that interfaces with WORD for mailmerges but
unfortunately the program passes a blank as a null instead of a
"0" when it comes to numbers. Here is my example I am hoping
someone can help me. I am trying to add two fields "a" and "b"
together but sometimes the "b" value might be blank and word
errors out when it trys to add a value and a blank. I need help
to properly add "a" and "b" when "b" is a null or if it has a
number. I hope someone seems to understand my delima and can help out.

Thansk,

Fred





  #12  
Old August 17th, 2008, 11:16 PM posted to microsoft.public.word.mailmerge.fields
Fred
external usenet poster
 
Posts: 1,451
Default Mailmerge Help

Macropod,

I have used your syntax line exactly as you had earlier and when the data is
merged, I get the following:

0

Now, if someone is able to get this to work for me, I will gladly pay them,
if it is not too expensive of course. I am not a programmer but I do well in
following directions.

Thanks,

Fred



"macropod" wrote:

Hi Fred,

If you use the coding version without the enclosing QUOTE field, you'll get syntax errors until the merge is run. That's because the
second field needs the bookmark from the first field, which won't have been set yet. Wrapping both fields in a QUOTE field ensures
they'r updated together.

--
Cheers
macropod
[MVP - Microsoft Word]


"Fred" wrote in message ...
This is what got returned:

!Syntax Error, +

{=+0}

"Graham Mayor" wrote:

Indeed! I wasn't doubting you

--

Graham Mayor - Word MVP

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



macropod wrote:
Hi Graham,

This approach is certainly more compact than using IF tests. My first
post in this thread shows how one could process many nuls without
resorting to a miriad of IF tests, and keeping the ultimate formula
intelligible.

"Graham Mayor" wrote in message
...
On a simple level I meant a level that the OP may understand It
was said that only b might be empty, but it would be easy enough to
process a in the same way. I do like your second version --

Graham Mayor - Word MVP

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



macropod wrote:
Hi Graham,

What if Mergefield 'a' can return nul also? The field code I posted
deals with both scenarios. To deal with just 'b', one could also
use: {QUOTE{SET b {MERGEFIELD b}}{={MERGEFIELD a}+b \# 0}}
or even:
{SET b {MERGEFIELD b}}{={MERGEFIELD a}+b \# 0}
which is simpler still!


"Graham Mayor" wrote in message
...
On a more simple level you could just use a conditional field eg

{={Mergefield a} + {IF {Mergefield b} = "" "0" "{Mergefield b}"}}


--

Graham Mayor - Word MVP

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




Fred wrote:
I have a program that interfaces with WORD for mailmerges but
unfortunately the program passes a blank as a null instead of a
"0" when it comes to numbers. Here is my example I am hoping
someone can help me. I am trying to add two fields "a" and "b"
together but sometimes the "b" value might be blank and word
errors out when it trys to add a value and a blank. I need help
to properly add "a" and "b" when "b" is a null or if it has a
number. I hope someone seems to understand my delima and can help out.

Thansk,

Fred





  #13  
Old August 17th, 2008, 11:25 PM posted to microsoft.public.word.mailmerge.fields
Fred
external usenet poster
 
Posts: 1,451
Default Mailmerge Help

Macropod,

Never mind. I am sorry. It was my fault. I guess I need some good glasses
because I was off a little bit on the {{.

You did an awesome job and I thank you very much!!!!!

Thanks,

Fred

"macropod" wrote:

Hi Fred,

If you use the coding version without the enclosing QUOTE field, you'll get syntax errors until the merge is run. That's because the
second field needs the bookmark from the first field, which won't have been set yet. Wrapping both fields in a QUOTE field ensures
they'r updated together.

--
Cheers
macropod
[MVP - Microsoft Word]


"Fred" wrote in message ...
This is what got returned:

!Syntax Error, +

{=+0}

"Graham Mayor" wrote:

Indeed! I wasn't doubting you

--

Graham Mayor - Word MVP

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



macropod wrote:
Hi Graham,

This approach is certainly more compact than using IF tests. My first
post in this thread shows how one could process many nuls without
resorting to a miriad of IF tests, and keeping the ultimate formula
intelligible.

"Graham Mayor" wrote in message
...
On a simple level I meant a level that the OP may understand It
was said that only b might be empty, but it would be easy enough to
process a in the same way. I do like your second version --

Graham Mayor - Word MVP

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



macropod wrote:
Hi Graham,

What if Mergefield 'a' can return nul also? The field code I posted
deals with both scenarios. To deal with just 'b', one could also
use: {QUOTE{SET b {MERGEFIELD b}}{={MERGEFIELD a}+b \# 0}}
or even:
{SET b {MERGEFIELD b}}{={MERGEFIELD a}+b \# 0}
which is simpler still!


"Graham Mayor" wrote in message
...
On a more simple level you could just use a conditional field eg

{={Mergefield a} + {IF {Mergefield b} = "" "0" "{Mergefield b}"}}


--

Graham Mayor - Word MVP

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




Fred wrote:
I have a program that interfaces with WORD for mailmerges but
unfortunately the program passes a blank as a null instead of a
"0" when it comes to numbers. Here is my example I am hoping
someone can help me. I am trying to add two fields "a" and "b"
together but sometimes the "b" value might be blank and word
errors out when it trys to add a value and a blank. I need help
to properly add "a" and "b" when "b" is a null or if it has a
number. I hope someone seems to understand my delima and can help out.

Thansk,

Fred





 




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:51 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.