View Single Post
  #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