Beginner question

V

vul

Although I'm pretty comfortable with VB6, I never did anything in Word,
except of course simple things such as creating a document, formatting,
saving, printing etc.
Now I have a request from my boss as follows:

1. In Word document at the beginning should be placed a set of controls -
several check boxes and several option buttons.
2. After these controls there are several blocks of text.
3. The only person have the ability to change selections, and after
selection is made and the document is saved, other people cannot see
controls and the blocks of text which were hidden by the person who made
selection.

In other words - there is a document like a template with all available
blocks of text. Customized copies of this template are created from this
template.

Any idea where do I start?

Thank you
Al
 
J

Jay Freedman

Although I'm pretty comfortable with VB6, I never did anything in Word,
except of course simple things such as creating a document, formatting,
saving, printing etc.
Now I have a request from my boss as follows:

1. In Word document at the beginning should be placed a set of controls -
several check boxes and several option buttons.
2. After these controls there are several blocks of text.
3. The only person have the ability to change selections, and after
selection is made and the document is saved, other people cannot see
controls and the blocks of text which were hidden by the person who made
selection.

In other words - there is a document like a template with all available
blocks of text. Customized copies of this template are created from this
template.

Any idea where do I start?

Thank you
Al

Hi Al,

Since you want both check boxes and option buttons, I'd recommend
building a userform -- a custom dialog box -- that's launched by an
AutoNew macro in the template. This macro runs automatically when you
use File > New to create a document from the template.

The userform can have all sorts of controls in it, and macro code
associated with them to make sure the selection of information makes
sense and nothing has been omitted. The code attached to the OK button
then does all the work in the document to assemble the right parts.

You can choose either of two ways to make the document. One is to
store the building-block segments of text in AutoText entries in the
template, and the userform code can insert those blocks into an
initially empty document. The alternative is to have all the possible
segments in the body of the template, covered with bookmarks, and have
the userform code delete any blocks that aren't needed. The AutoText
method works better if you need to alter the order of the blocks from
one document to another.

Once the document is saved and disconnected from the template, there's
no chance of someone else running the userform and changing the
selection -- it's just a document, containing whatever was put there.
 
V

vul

Thank you very very much.
I tried your suggestions and it looks like this is exactly what I wanted.
I just did not know that there is such a feature as UserForm.

Al
 

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