PDA

View Full Version : Gnereating a word document w/ checkbox



fadib
12-18-2007, 01:38 PM
HI guys,
I am new into word vba, I need some guidance on how to start.
what I have in mind is a document with n numbers of paragraph.

Example:
1-Monday
<words>
2-Tuesday
<words>
3-...

On the first page I want to have a list of checkbox for each title of a paragraph.
Initially the all boxex are checked.
When the user uncheck the box the corresponding paragraph will be ommited from the word document, and when the user check it again, it reappears.

I am not sure if this is an easy way to do it.

I thaught of a different way too, and I would like to learn both methods.
I can create a word document for each file.
I will also make a userform that will open as soon as the word document opens.
the user will have to check the boxes he or she needs, and by the click of a button, the word document is created which contains only the paragraphs selected by the user.

:help

fumei
12-19-2007, 10:31 AM
Like this? Userform will display on document open. Select the paragraphs you want and click the commandbutton DoIt!

fadib
12-19-2007, 02:39 PM
Yes this is what I want, but I have a small issue with that.
The program doesn't consider the user unchecking the box.
How can I keep the userform always on.
When the user check the box the paragraph stays and when the user uncheck the box, the paragraph is deleted?

In another way saying, the user will select what he wants, then DoIt!
If they forgot to select something, they can check and uncheck until they are ready to print.

fumei
12-20-2007, 10:50 AM
Then you need something else. The first thing is...you need to clearly, explicitly, figure out your requirements.

"The program doesn't consider the user unchecking the box. "

It most certainly does consider it. It does not do anything until the users clicks DoIt. they can check and uncheck all they want until then.

"How can I keep the userform always on."

1. why would you want to?
2. you can't, and even if you could, again...why would you?

"In another way saying, the user will select what he wants, then DoIt!
If they forgot to select something, they can check and uncheck until they are ready to print."

This is a whole other requirements from what you originally asked.

"I will also make a userform that will open as soon as the word document opens.
the user will have to check the boxes he or she needs, and by the click of a button, the word document is created which contains only the paragraphs selected by the user. "

The example posted does precisely, exactly, that.

TrippyTom
01-07-2008, 10:01 AM
Fumei, thank you for this. I came upon a need similar to this, and I think I will be able to utilize your solution for my needs! Thanks so much.