Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
{ 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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
How do I display the ASCII hex values in text document? | Microsoft Word Help | |||
Show names and values are checked but do not display on graph | Microsoft Word Help | |||
In MS Word 2003 how do I display values as both numbers and text? | Microsoft Word Help | |||
Problem arises when ref bookmark is added in the header ,it does not take the modified values and displays the same old values | Microsoft Word Help | |||
Problem arises when ref bookmark is added in the header ,it does not take the modified values and displays the same old values | Microsoft Word Help |