How to generate a document chosing different sections from a templ

Y

Yannick

OK, the title might not be so clear, so I will explain what I try to do.
I want to create a template document from which specific documents will be
produced. So, for example, in my template document, I have 10 different
sections (parts of the document, no matter if it is identified as a section
or as something else). Then, from this template, I want to create a document
containing only sections 1, 3, 4, 8, another one with sections 1, 10, and a
last one with sections 2, 3, 7, 9, 10.
Ideally, I would like to be able to generate these documents quickly, by
doing something like: "Create new document from the template xxx" and then
just check the desired sections in a list.
Maybe am I dreaming, but I guess I am not the first one wanting to do such a
thing.
So, is it possible? How?
Any help is appreciated.
Thank you in advance
 
Y

Yannick

Thanks Graham. It seems it might help me. However, I am a dummy in Macros...
So I would need furthr help.
I succeeded in creating a form with "CheckBox1", displaying the content of
"Doc1.doc" if checked, "CheckBox2", displaying the content of "Doc2.doc" if
checked, ... But what I did is to create a separate macro for every checkbox.
How could I do only one macro, which would display the content of "DocX.doc"
if "CheckBoxX" is checked (X being variable) (and do not display anything if
not checked). I guess I have to do a "For Each..." but I don't know more...
If you can hlep me on this, it would be wonderful!

Thanks already
 
J

Jay Freedman

I'll just add that if you'd rather not do all the work yourself,
there's a commercial product called DataPrompter
(http://www.wordsite.com/products/dpdas.htm) -- from the company run
by fellow Word MVP Billl Coan -- that easily assembles documents of
this kind.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
G

Graham Mayor

In the circumstances it might be better to set up a simple userform.

Imagine a userform with three check boxes and a command button (each with
their default names). The macro associated with the form command button
could be (at its simplest)

Private Sub CommandButton1_Click()
Unload Me
If Me.CheckBox1.Value = True Then
Selection.InsertFile FileName:="D:\My Documents\Doc1.docx"
End If
If Me.CheckBox2.Value = True Then
Selection.InsertFile FileName:="D:\My Documents\Doc2.docx"
End If
If Me.CheckBox3.Value = True Then
Selection.InsertFile FileName:="D:\My Documents\Doc3.docx"
End If
End Sub

which will insert the documents into the current document in the order shown
according to which check box is checked. Embroider to suit your application.
For the basics, see Word MVP FAQ - Userforms
http://word.mvps.org/FAQs/Userforms.htm

for a more in depth explanation, see
http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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