Re: Multiple versions of a document (DETAILED)

Subject: Re: Multiple versions of a document (DETAILED)
From: "David M. Brown" <dmbrown -at- brown-inc -dot- com>
To: "TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Sat, 24 Mar 2001 10:09:53 -0800

Jersey wrote:
>
> I want to have a DocumentA, which includes Chap1.doc,
> Chap3.doc, and Chap4.doc. I also want to have a
> DocumentB, which includes Chap1.doc, Chap2.doc, and
> Chap3.doc. Can I do this while maintaining only one
> copy of each chapter file?
>
> Can Word do something like this?

You could set up a variable and use it to control contents, something like this:

{ set whichPet "dogs" }
<title page>
<copyright page>
--------section break--------
{ TOC }
--------section break--------
<introductory pages>
--------section break--------
{ IF whichPet = "dogs" { INCLUDETEXT "dogs1.doc" } { INCLUDETEXT "cats1.doc"} }
--------section break--------
{ IF whichPet = "dogs" { INCLUDETEXT "dogs2.doc" } { INCLUDETEXT "cats2.doc"} }
--------section break--------
{ IF whichPet = "dogs" { INCLUDETEXT "dogs3.doc" } { INCLUDETEXT "cats3.doc"} }
--------section break--------
{ Index }

The general form of the IF field is:

{ IF bookmark testCondition "value" textIfTrue textIfFalse }

Knowing that and the fact that fields can be nested, you can create fancy if-then-else conditionals like this:

{ IF whichPet = "dogs"
{ INCLUDETEXT "dogs1.doc" }
{ IF whichPet = "cats"
{ INCLUDETEXT "cats1.doc"}
{ IF whichPet = "fish"
{ INCLUDETEXT "fish1.doc" }
""
}
}
}

which means:

If I set whichPet to "dogs" then insert the contents of dogs1.doc here.
If I set whichPet to "cats" then insert the contents of cats1.doc here.
If I set whichPet to "fish" then insert the contents of fish1.doc here.
If whichPet isn't one of those three values, don't insert anything.

All you have to do is change the bookmark at the top of the file, press Ctrl+A to select the entire document, then press F9 to update all your fields. Voila! New version.

To archive a released version, press Ctrl+A again, and then press Ctrl+Shift+F9. All the conditional text (the inserted files) is no longer conditional--it's just plain text, which you can save (as 03-23-2001-release.doc, for example) for posterity. (The field codes are GONE--you can never update them again--so be sure you save it to a different file.)

Notes:

* I've never tried breaking the IF field across multiple lines
with hard carriage returns. It'd probably work, but I just
showed it that way to make it easier to see the logic.

* As far as I know, you can't use the value of the variable in
the name of the included file. (Don't try to get TOO tricky!)

* There are "certain peculiarities" about files inserted using
the INCLUDETEXT field. Discovering them is part of the fun
of stretching a nifty feature beyond the purposes for which
it was designed. Have fun! :)

--David

=============================
David M. Brown - Brown Inc.
dmbrown -at- brown-inc -dot- com
=============================

A V A I L A B L E N O W ! http://www.html-indexer.com/

HTML Indexer 3, still the easiest way to create and maintain real
back-of-the-book indexes for web sites and other HTML documents.

Now including options for HTML Help and JavaHelp indexes, too!

 

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

*** Deva(tm) Tools for Dreamweaver and Deva(tm) Search ***
Build Contents, Indexes, and Search for Web Sites and Help Systems
Available 4/30/01 at http://www.devahelp.com or info -at- devahelp -dot- com

A landmark hotel, one of America's most beautiful cities, and
three and a half days of immersion in the state of the art:
IPCC 01, Oct. 24-27 in Santa Fe. http://ieeepcs.org/2001/

---
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.


Previous by Author: Re: Search inside a PDF?
Next by Author: Re: Task-based vs. descriptive online help
Previous by Thread: CONVERSION TOOL FROM PDF TO WORD DOCS
Next by Thread: Writing for the Web Site


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


Sponsored Ads