Re: Evaluating a MERGEFIELD = "RET"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I was too lazy to read the whole post, but with your information I was able
to figure out what to do and then had a good explanation to get started at
understaning it a little more completly.

I invested my time instead in some hands on learning and found that you did
have to use the Bookmark somewhere in the template document before it would
cause the "inconsistancy" and automatically translate the RET brought in by
the merge field into the bookmark value.

It appears that it is double translating unless we put the quotes around the
reference to the datafile. But I think that was making it even more of a
challenge is that the double translation is not happening all the time. The
reference is treated as just a reference to the datafile if you don't use the
bookmark reference elsewhere in the template.

I don't think the mere existence of the bookmark in a referenced document
(for expamle I have multiple references to a bookmark collection and am
referencing other bookmarks from the file containing the collection) until
you use that specific bookmark in the template document, which makes a LITTLE
more sense after I thought about it.

Thanks again for the help, keep up the good work.



It looks like once a reference is made within the template, that it likes to
take a little shortcut and remember that reference translation.

"Peter Jamieson" wrote:

Try

{ IF "{ MERGEFIELD AdmitType }" = "RET" "test" "what" }

(If field syntax cannot in the general case be as minimal as is generally
thought - however, in this case, the chances are that the problem is caused
by having a bookmark called RET in your document).

Peter Jamieson
"Michael Holz" <Michael Holz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:13A98DBD-30B8-4C70-8DB1-3F08E4CEBBEA@xxxxxxxxxxxxxxxx
This is a really wierd one. I am guessing that "RET" may have some
reserved
meaning and it is interfering with my IF statement, but not sure.

So here is what I'm trying to do. In Office 2003, I'm doing an
INCLUDETEXT
thing when a certain MERGEFIELD = "RET" which is something that we pull to
a
data .csv file from our database. I've dumbed it down for myself for
testing
to take out all but the easy stuff so I could make sure that I isolated
the
problem, and I still see this odd issue.

Here's what I've been using for testing when I discovered this issue.

"{IF{ MERGEFIELD AdmitType } = "RET" "test" "what"

No matter what I do this always outputs: what

I have verified that the field in the data file does in fact contain "RET"
by just printing "{MERGEFIELD AdmitType}" in the form letter. The
Mergefield
by itself in the form letter prints "RET"

In addition, I've also changed a single letter in the datafile so that
{MERGEFIELD AdmitType} contains "REM" and then changed the one character
in
the line of code so that the line of code reads:

"{ MERGEFIELD AdmitType } = "REM" "test" "what"

Then the output in the merge finally reads: test

Any suggestions as to how to get around this? Is there some type of
escape
character? Or is anyone else even able to duplicate this?




.



Relevant Pages

  • Re: Word automatically inserts page break when printing
    ... It would be helpful to see the ability to edit the document with the bookmark ... > field code shading on "Always" so you see the full cross reference shaded. ...
    (microsoft.public.word.tables)
  • Re: Referencing comments from another document?
    ... Word tells me that it can't find the reference. ... Herb Tyson MS MVP ... Blog: http://word2007bible.herbtyson.com ... REF "file" BOOKMARK ...
    (microsoft.public.word.docmanagement)
  • Re: Evaluating a MERGEFIELD = "RET"
    ... (for expamle I have multiple references to a bookmark collection and am ... you use that specific bookmark in the template document, ... reference is treated as just a reference to the datafile if you don't use the ...
    (microsoft.public.word.vba.general)
  • Re: updating Multiple references to automatic numbered figures
    ... dialog, you can specify that you want to reference the item number, rather ... Another method is to bookmark the destination, ... Inserting a number using the field tab allows the number to change ... automatically if I add a musical exercise to the text out of sequence (for ...
    (microsoft.public.word.docmanagement)
  • Re: Insert text from one file into the cells of a table in another
    ... and then reference that bookmark in the destination table? ... I can add an entire table into the cell of another using {INCLUDETEXT ... ... >> 27.1 Do something Verify something ...
    (microsoft.public.word.tables)