Re: Word and multiple conditions: a how-to

Subject: Re: Word and multiple conditions: a how-to
From: dmbrown -at- brown-inc -dot- com
To: "TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Wed, 17 Sep 2003 09:34:29 -0700


MList -at- chrysalis-its -dot- com wrote:
>
> Certain co-workers are of the opinion that Word can (reliably,
> cleanly, etc.) do something like what FM can do with Conditional
> Text, which is to say: make various words, paragraphs, objects,
> etc., appear or disappear throughout a big document, according
> to the setting of a global condition.


Yep, you can do this in Word. Way back in Word for Windows 2.0, I used two variables to create four books from one source file.

We had software that could run under Windows or OS/2 on systems plugged in to either VME or VXI bus racks. Whenever the software changed, I'd decide whether the change applied to a specific OS or bus, and set it up accordingly.

You use SET fields to establish the version you want to create:

{ SET sys = "w" } or { SET sys = "2" }
{ SET bus = "m" } or { SET bus = "x" }

and IF fields to test those variables and display the correct text:

Blah blah { IF sys = "w" { IF bus = "m" "text for Windows and
VME" { IF bus = "x" "text for Windows and VXI" "generic text
for Windows" } } { IF sys = "2" { IF bus = "m" "text for OS/2
and VME" { IF bus = "x" "text for OS/2 and VXI" "generic text
for OS/2" } } } "generic text" } blah blah blah.

In this case, I set the variables to the exact text of the OS and bus names, so I could use REF fields, too:

{ SET sys = "Windows" } or { SET sys = "OS/2" }
{ SET bus = "VME" } or { SET bus = "VXI" }

Thank you for buying { REF bus }bus Magician for { REF sys }!

Note that IF fields can specify only two pieces of text: the first is used if the comparison is true, the second is used if the comparison is false. To create multiple cases (a+1, a+2, b+1, b+2) you have to "nest" each new comparison into the "else" portion of the preceding comparison. This is easier to see if you write the sample paragraph like a piece of code:

Blah blah
{ IF sys = "w"
{ IF bus = "m"
"text for Windows and VME"
{ IF bus = "x"
"text for Windows and VXI"
"generic text for Windows"
}
}
{ IF sys = "2"
{ IF bus = "m"
"text for OS/2 and VME"
{ IF bus = "x"
"text for OS/2 and VXI"
"generic text for OS/2"
}
}
}
"generic text"
}
blah blah blah.

>
> ...a certain locally influential person seems to think that
> Word could handle this easily, for multiple sets of
> several-hundred-page documents... based (I guess) on her/his
> past-life success with form-letters.


Funny you should mention form letters--as recently as Word 2000, anyway, most of this is documented under the heading "mail merge." At 400 pages, the books I created were certainly pushing the intended use, but it worked.

>
> Maybe s/he's right. I'm leery. Is the above task a righteous
> use of the tool (Word), and I'm just a wienie?


Well, there are (or were) a couple of limitations.

Although the conditional text could contain paragraph marks, those paragraph marks didn't hold formatting information. They'd just be plain, vanilla paragraph breaks. Maybe they picked up the formatting of the paragraph in which they were embedded--but I don't remember it being even that sophisticated.

The practical result was that I always constrained conditional text to chunks smaller than one paragraph. That worked very well for my application, but might not for yours. On the other hand, maybe the problem has been fixed.

A related limitation was that the conditional text couldn't include conditional index entries (XE fields). All the index entries showed up in the index, so I had to be creative to avoid index entries that applied only to specific versions. Given the level of attention Microsfot pays to indexing, I'd be surprised if that's been fixed.

>
> They want to try it with our Test Cases and other QA documents...


Start with the paragraph above to see how it works, and gradually increase the complexity of the text you include. (You can check to see whether that paragraph formatting limitation has been fixed.)

Then find the simplest of your own documents that comes in multiple versions, determine the variables that control the differences among those versions, identify the text that differs among versions, and move that variable text into IF fields.

>
> The criteria are that it be set-up then run in automated fashion,
> and then require only minimal tweaking/fixing, of the generated
> documents.


If you do it correctly, no tweaking will be required. I did put a lot of time into the initial setup, which my manager supported because we knew one person couldn't keep four separate books synchronized at the pace with which changes were being made.

Once I got it set up, my work flow was:

1. Edit the doc, being careful to analyze the versions
affected by any given change.

2. Set the two variables at the top of the file.

3. Press Ctrl+A, then press F9 to update all the fields.

4. Print the book. (It was 1990.)

5. Save an archive copy of the file as printed, with all the
fields converted to regular text (Ctrl+A, Ctrl+Shift+F9).


If you're unfamiliar with Word fields, be sure to read about them in the online help. For one thing, it'll mention that you can't just type those braces--they're special characters Word inserts when you press F9. (I prefer to type the field contents by hand, rather than using any of the Insert commands.)

Have fun!

--David

========================================================================

HTML Indexer 4 is still the easiest way to create and maintain indexes
for web sites, intranets, HTML Help, JavaHelp, and other HTML documents.

HTML Indexer 4 includes fully integrated cross-references, target frames
and windows, multiple-file output, "one-step accept" of default entries,
and more!

http://www.html-indexer.com/





^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

NEED TO PUBLISH YOUR FRAMEMAKER CONTENT ONLINE?
?Mustang? (code name) is a NEW online publishing tool for FrameMaker that
lets you easily single-source content to Web, intranets, and online Help.
The interface is designed for FrameMaker users, so there is little or no
learning curve and no macro language required! See a live demo that
will take your breath away: http://www.ehelp.com/techwr-l3

---
You are currently subscribed to techwr-l as:
archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit
http://www.raycomm.com/techwhirl/ for more resources and info.



Follow-Ups:

References:
Word and multiple conditions (a cutting edge skill?): From: MList

Previous by Author: Re: India - Wave of the Future?
Next by Author: Re: Word and multiple conditions: a how-to
Previous by Thread: Re: Word and multiple conditions (a cutting edge skill?)
Next by Thread: Re: Word and multiple conditions: a how-to


What this post helpful? Share it with friends and colleagues:


Sponsored Ads