Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default How display values of {SET foo} variables?

Hi:

In working through the logic of a many-to-one directory mail merge,
I've created some variable with the {SET var} expression:

[SET foo {MERGEFIELD F1}}
{SET bar {MERGEFIELD F2}}

and I'm testing them, as with

{IF foo bar "true" "false"}

But I haven't been able to figure out how to display the actual
current values of 'foo' and 'bar' in the document so I can debug the
logic.

I've tried:
foo= {foo}
bar= {bar}

but it doesn't do it.

Thanks in advance.

-- Roy Zider
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How display values of {SET foo} variables?

Hi Roy,

Try:
{foo} and {bar}
or:
{REF foo} and {REF bar}

More generally, for a many-to-one directory mail merge, check out my Word 97-2007 Catalogue/Directory Mailmerge Tutorial at:
http://lounge.windowssecrets.com/ind...owtopic=731107
or
http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
Do read the tutorial before trying to use the mailmerge document included with it.


--
Cheers
macropod
[Microsoft MVP - Word]


"FUBARinSFO" wrote in message ...
Hi:

In working through the logic of a many-to-one directory mail merge,
I've created some variable with the {SET var} expression:

[SET foo {MERGEFIELD F1}}
{SET bar {MERGEFIELD F2}}

and I'm testing them, as with

{IF foo bar "true" "false"}

But I haven't been able to figure out how to display the actual
current values of 'foo' and 'bar' in the document so I can debug the
logic.

I've tried:
foo= {foo}
bar= {bar}

but it doesn't do it.

Thanks in advance.

-- Roy Zider

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default How display values of {SET foo} variables?

{ foo }
and
{ REF foo }
should work, but only if the { } are the special field braces you can
insert using ctrl-F9

But for this type of application you could usefully look at the
following two references:
a. Doug Robbins' stuff at

http://www.gmayor.com/ManyToOne.htm

a. macropod's tutorial - I quote:

-------------------
You can use Word's Catalogue/Directory Mailmerge facility for this (the
terminology depends on the Word version). To see how, check out my Word
97-2007 Catalogue/Directory Mailmerge Tutorial at:
http://lounge.windowssecrets.com/ind...owtopic=731107
or
http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
Do read the tutorial before trying to use the mailmerge document
included with it.
-------------------

Beware of odd behaviour of comparands in IF statements - e.g. if a SET
variable contains a text such as 123-45, Word may actually see it as a
calculation. Also, if the value of { MERGEFIELD F1 } is set to "bar",
i.e. you set foo to bar, you may find that Word actually uses the value
of the bar SET variable when you specify foo. Sometimes it may make
sense to use syntax that can avoid those problems, such as

{ IF "{ REF foo }" "{ REF bar }" "true" "false" }

Peter Jamieson

http://tips.pjmsn.me.uk

On 21/02/2010 23:24, FUBARinSFO wrote:
Hi:

In working through the logic of a many-to-one directory mail merge,
I've created some variable with the {SETvar} expression:

[SET foo {MERGEFIELD F1}}
{SET bar {MERGEFIELD F2}}

and I'm testing them, as with

{IF foo bar "true" "false"}

But I haven't been able to figure out how to display the actual
current values of 'foo' and 'bar' in the document so I can debug the
logic.

I've tried:
foo= {foo}
bar= {bar}

but it doesn't do it.

Thanks in advance.

-- Roy Zider

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default How display values of {SET foo} variables?

For some reason, neither of the statements are displaying the value on
merge:

{SET VAR1 = "foo"}
{SET VAR2 = "bar"}

Var1: {var1}
Var2: {REF var2}

In contrast, I do know how to display stuff. This works OK:

Mergeseq variable: {MERGESEQ}
Mergerec variable: {MERGEREC \* MERGEFORMAT}

Yes, the above braces are Ctrl-F9 braces. And I have referenced the
links to the excellent tutorials and code. What I am doing is working
some of this out for myself, and find I can't even get this little
thing straight.

-- Roy
  #5   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 How display values of {SET foo} variables?

You should not include the "=" sign and have you updated the fields. The
bookmarks are not created until the { SET } field has been updated.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"FUBARinSFO" wrote in message
...
For some reason, neither of the statements are displaying the value on
merge:

{SET VAR1 = "foo"}
{SET VAR2 = "bar"}

Var1: {var1}
Var2: {REF var2}

In contrast, I do know how to display stuff. This works OK:

Mergeseq variable: {MERGESEQ}
Mergerec variable: {MERGEREC \* MERGEFORMAT}

Yes, the above braces are Ctrl-F9 braces. And I have referenced the
links to the excellent tutorials and code. What I am doing is working
some of this out for myself, and find I can't even get this little
thing straight.

-- Roy




  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default How display values of {SET foo} variables?

If you are actually doing
{ SET VAR1 = "foo" }

then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

{ SET VAR1 "foo" }
would do it, or

{ SET VAR1 foo }

if there are no spaces in the text.

But assuming that is not the problem, are you actually seeing

Var1:
Var2:

in the output? If not, my best guess is that you might have nested those
lines in another field in such a way that they would never output. If
you are seeing them, could it be that the SET fields have not executed
because they are nested inside an IF, or some such?

Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 00:13, FUBARinSFO wrote:
For some reason, neither of the statements are displaying the value on
merge:

{SET VAR1 = "foo"}
{SET VAR2 = "bar"}

Var1: {var1}
Var2: {REF var2}

In contrast, I do know how to display stuff. This works OK:

Mergeseq variable: {MERGESEQ}
Mergerec variable: {MERGEREC \* MERGEFORMAT}

Yes, the above braces are Ctrl-F9 braces. And I have referenced the
links to the excellent tutorials and code. What I am doing is working
some of this out for myself, and find I can't even get this little
thing straight.

-- Roy

  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default How display values of {SET foo} variables?

Doug and Peter:

Programming is humbling:
.................................................. ....................
You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )

You should not include the "=" sign
then VAR1 will actually be set to "=" (in which case you might not be
noticing the output :-) )
.................................................. ....................................

Uhh, OK. I think I got it now. Duhhh.

Thank you so much. Maybe I can even remember this.

-- Roy
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 do I display the ASCII hex values in text document? capndave Microsoft Word Help 5 May 1st 23 02:51 PM
Show names and values are checked but do not display on graph Academy Student Microsoft Word Help 0 August 31st 09 03:35 PM
In MS Word 2003 how do I display values as both numbers and text? RofeBeast Microsoft Word Help 3 March 10th 09 01:33 PM
Problem arises when ref bookmark is added in the header ,it does not take the modified values and displays the same old values divya Microsoft Word Help 2 July 6th 06 01:08 PM
Problem arises when ref bookmark is added in the header ,it does not take the modified values and displays the same old values divya Microsoft Word Help 0 July 6th 06 11:47 AM


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