Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using SEQ with IF fields

161 views
Skip to first unread message

Cristina Cramer

unread,
Mar 30, 2001, 3:55:14 PM3/30/01
to
I'm having a bit of a strange problem with SEQ fields. My company uses mail
merge extensively to produce different kinds of paperwork, using IF fields
to choose alternate language. In a few places I've used SEQ fields to avoid
the aggravation of automatic numbering, especially when there are
intervening unnumbered paragraphs; but when I include a SEQ field inside an
IF, the final document will always skip that number if that piece of text is
not included in the document (as if Word detects the SEQ field and includes
it in the sequence, even though it doesn't show in the final document). In
order to get around this, I've also included an IF inside the SEQ field to
give it a different bookmark name if the IF statement is not true, thus
making the SEQ field part of a different list. I end up with something like
this:

{IF {MERGEFIELD fieldname} = "T" "{SEQ {IF {MERGEFIELD fieldname} = "T'
"list" "nolist" }}. This is the text of the paragraph . . ." }

So if {fieldname} is true, the SEQ will belong to the sequence "list" and
print in the document; and if {fieldname} is false it will belong to the
different sequence "nolist", and not affect the numbers that actually appear
in the final merged document. This is kind of ugly, but it works.

I neglected to mention I'm using Word 95 (ver. 7.0) on Win 95. The problem
has appeared because I've started testing some of our documents in Word
2000, in anticipation of eventually upgrading to 2000 (no set timeline for
the change yet, but I'm getting a head start--lots of documents to test).
When I save the document as a Word 2000 file and merge, I get an even-number
list (2, 4, 6, etc.). I've tried updating all fields, both with data
attached and without, updating each SEQ field individually, changing
bookmark names, removing the IF inside the SEQ field, editing my data so
that different sections of text are included or excluded from the
document--the results vary, but nothing I do produces a normal numbered
list. I've removed the SEQ fields and replaced them even, with the same
bookmark names and with different ones, but I still get the same weird
results. If I enter SEQ's from scratch in Word 2000 and add IF fields
inside to change the bookmark names, they work exactly the same as they do
in Word 95, which is what I want. My questions are,

1. Is there anything I'm overlooking that may be causing my document to
behave differently under Word 2000? I've read in several places that SEQ
fields aren't supposed to break over different versions of Word; but I've
also never heard of anyone else using IFs inside SEQs. I can't think of
anything else to try to get it to work.

2. Is there a less tortuous way to make SEQ fields work with IFs?
Everything I know about Word I've mainly taught myself over the past year or
so; I wouldn't doubt that I've missed an easier way to do this.

Sorry for the length of this post, I'm trying to be as clear as I can and I
still feel like I'm failing miserably . . . Any suggestions are welcome.
Thanks!

Cristina


Steve Glynn

unread,
Mar 31, 2001, 4:46:04 AM3/31/01
to
Cristina

Peter Jamieson's reply to my post "Help with SEQ and custom numbering,
please" (29/3) may answer some of your questions (if you can't find the
thread on your news server, email me and I'll send you a copy).

If you're upgrading to Word 2000, you should be examining the new ListNum
field, which effectively replaces SEQ and is a lot easier to use.
Essentially, you define a custom numbering system in Format-Bullets and
Numbering-Outline Numbering (I think you have to click on the "More" button
to see the ListNum section), and give it a name.

Then you insert the ListNum field in your text, tell it which custom
numbering system to use, and use a couple of switches to define the
numbering level for that particular paragraph.

It's infinitely simpler, imo, than SEQ.

Steve

"Cristina Cramer" <cmcr...@cmsbenefits.com> wrote in message
news:eLu4UwVuAHA.2008@tkmsftngp02...

Peter Jamieson

unread,
Mar 31, 2001, 3:04:39 PM3/31/01
to
NB apologies if you find missing "t" keystrokes in here - my keyboard is
playing up.

> 1. Is there anything I'm overlooking that may be causing my document to
> behave differently under Word 2000?

Not as far as I can see. I have checked a document with fields similar to
yours, created in Word 95 and opened in Word 2000, and had the same results
as yours.

> I've read in several places that SEQ
> fields aren't supposed to break over different versions of Word; but I've
> also never heard of anyone else using IFs inside SEQs. I can't think of
> anything else to try to get it to work.

To cut a long story short,
a. I think he problem has to do with WOrd 95 and WOrd 2000 doing the
evaluation of "unused branches" of the IF field differently
b. In Word 95 at any rate, none of the obvious sneaky tricks I can think of
to get SEQ to display sometimes and not other times work. As jus one
example:

{ SEQ { IF "{ MERGEFIELD T }" = "T" "LIST" "NOLIST \h" } }

doesn't work (in fact there should be two backslashes before the h but they
may not appear correctly in your newsreader.

I wouldn't claim to have tried /all/ possibilities but the only reasonably
simple approach that I have been able to make work is to use INCLUDETEXT
with bookmarks in the included file for the { SEQ } field and another test
for the text part of the paragraphs.

All I can think of is something even more wordy than the approach you ahve
at the moment, like

{ INCLUDETEXT "..\\TBM.DOC" "{ IF "{ MERGEFIELD fieldname}" = "T" "T"
"F" }" }{ IF "{ MERGEFIELD fieldname }" = "T" "text ..." "" }

To do this, make a .doc file with one row containing { SEQ list } and
bookmark the field - call the bookmark T, and exclude any paragraph marks
from the area you bookmark. You have to use a bookmark or the final
paragraph mark will always be included in your output. Then move the
insertion point to he end of he documen (so it is a "point" selection) and
create a bookmark "F".

Doing things this way takes the SEQ out of any IF statement, so the SEQ is
only executed when it is needed.

I think you can simplify it a bit (I haven't tried) if you only ever have
values T and F for fieldname:

{ INCLUDETEXT "..\\TBM.DOC" "{ MERGEFIELD fieldname}" }{ IF "{ MERGEFIELD
fieldname }" = "T" "text ..." "" }

Once you've gone down the INCLUDETEXT route you have all sorts of options,
but I leave that to you.

> Sorry for the length of this post, I'm trying to be as clear as I can and
I
> still feel like I'm failing miserably . . . Any suggestions are welcome.

It seemed pretty clear to me.

--
Peter Jamieson
MS Word MVP

"Cristina Cramer" <cmcr...@cmsbenefits.com> wrote in message
news:eLu4UwVuAHA.2008@tkmsftngp02...

Cristina Cramer

unread,
Apr 2, 2001, 9:20:24 AM4/2/01
to
Steve and Peter, thanks very much for your suggestions. The ListNum field
sounds like it might work for what I'm trying to do, I hadn't run across it
yet in exploring Word 2000. I will keep your other suggestions in mind
also, for future reference. Thanks again!
Cristina Cramer


Cristina Cramer <cmcr...@cmsbenefits.com> wrote in message
news:eLu4UwVuAHA.2008@tkmsftngp02...

0 new messages