TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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:
{ 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
=============================
*** 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.