How many ways to do it?

L

Len B

Years ago, I had occasion to produce a custom document based on other
documents. In those DOS days I used WordStar which had a concept of a
control document and a variables document.

The variables document (ASCII) contained things like -
set name=Fred Smith
set age=45

The control document would be like this -
include variables.txt
set number=7
if age<50 then include young1.doc else include old1.doc
include terms.doc (could include merge variables like age)
if age<50 then include young2.doc else include old2.doc
include summary.doc (could merge Fred's name, age etc. too)
if number ... etc. etc.

I would programmatically create a variables.txt for Fred Smith overwriting
the former variables.txt and I would then print the control document which
would take care of formatting, page breaks and the like to produce the
custom document to suit Fred.

What ways do you see to accomplish a similar task now using Word? I
anticipate a boilerplate document of some sort and something like Access
producing another document to drive/control the process of
including/excluding other documents and inserting or merging variables like
age or DoB in the boilerplate. The end result would be a document tailored
to Fred.

If someone could suggest a technique or two along with some relevant
keywords to search the help on, I would appreciate it.

TIA
 
G

Graham Mayor

You can do much the same thing with either SET fields, ASK fields or (more
sophisticated) with Userforms
http://word.mvps.org/FAQs/Userforms.htm and use conditional fields to employ
the results eg

{ ASK Age Age }{ IF { Age } > 50 "{ IncludeText C"\\path\\old.doc" }" "{
IncludeText C"\\path\\young.doc" }" }

will insert old.doc or young.doc

{ ASK Age Age }{ ASK Name Name }{ IncludeText c:\\path\\{Ref Age}{Ref
Name}.doc"}

will insert c:\path\agename.doc
etc

See http://www.gmayor.com/formatting_word_fields.htm

See also the boiler.dot add-in you can download from my web site which will
insert a document or documents at the cursor.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
L

Len B

Thanks Graham,
I have not heard of userforms before so I'll check them out. I've just
downloaded boiler.dot so I'll look into that too.

Congrats on your site. I know where I'll look next time I have a Word
question.
Thanks again.
--
Len
______________________________________________________
remove nothing for valid email address.
| You can do much the same thing with either SET fields, ASK fields or (more
| sophisticated) with Userforms
| http://word.mvps.org/FAQs/Userforms.htm and use conditional fields to
employ
| the results eg
|
| { ASK Age Age }{ IF { Age } > 50 "{ IncludeText C"\\path\\old.doc" }" "{
| IncludeText C"\\path\\young.doc" }" }
|
| will insert old.doc or young.doc
|
| { ASK Age Age }{ ASK Name Name }{ IncludeText c:\\path\\{Ref Age}{Ref
| Name}.doc"}
|
| will insert c:\path\agename.doc
| etc
|
| See http://www.gmayor.com/formatting_word_fields.htm
|
| See also the boiler.dot add-in you can download from my web site which
will
| insert a document or documents at the cursor.
|
| --
| <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
| Graham Mayor - Word MVP
|
| My web site www.gmayor.com
|
| <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
|
|
| Len B wrote:
| > Years ago, I had occasion to produce a custom document based on other
| > documents. In those DOS days I used WordStar which had a concept of a
| > control document and a variables document.
| >
| > The variables document (ASCII) contained things like -
| > set name=Fred Smith
| > set age=45
| >
| > The control document would be like this -
| > include variables.txt
| > set number=7
| > if age<50 then include young1.doc else include old1.doc
| > include terms.doc (could include merge variables like age)
| > if age<50 then include young2.doc else include old2.doc
| > include summary.doc (could merge Fred's name, age etc. too)
| > if number ... etc. etc.
| >
| > I would programmatically create a variables.txt for Fred Smith
| > overwriting the former variables.txt and I would then print the
| > control document which would take care of formatting, page breaks and
| > the like to produce the custom document to suit Fred.
| >
| > What ways do you see to accomplish a similar task now using Word? I
| > anticipate a boilerplate document of some sort and something like
| > Access producing another document to drive/control the process of
| > including/excluding other documents and inserting or merging
| > variables like age or DoB in the boilerplate. The end result would be
| > a document tailored to Fred.
| >
| > If someone could suggest a technique or two along with some relevant
| > keywords to search the help on, I would appreciate it.
| >
| > TIA
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top