Autotext insertion based on checkbox selection- Help really needed!

Joined
Aug 13, 2012
Messages
2
Reaction score
0
Hi,
Im really hoping someone can help me. I am trying to create a (to me) pretty complex form, and my IT department cannot help me. I should preface this by saying that my biggest accomplishment in Word doc creation is figuring out the cross-reference/bookmark function. I do not know how to create macros, etc., but I am able to follow clear directions.

Ok, here is what I am trying to do. I have a form that I am creating, where I have a list of 37 items. Next to these items, I want to put checkboxes. When a user clicks a checkbox, I want a piece of text, unique to each checkbox, to appear several places in the form. When a checkbox is not clicked, I do not want that text to appear. And, I have to do this for all 37 checkboxes.

To explain this more fully... If I have a list of fruit: Apples, Bananas, Oranges, etc, each one with a checkbox next to it, and I ask the user to click all of the fruits they like, is it possible that if they click the box next to 'Apples', I can have a piece of text, say "I love Apples," appear several times in the form? (And so on with checking the box next to 'Oranges' equalling the text, "I love Oranges," appear several times in the form.) But if the checkboxes are blank, the text does not appear.

I have been researching this and trying to figure it out for a couple of weeks now. I have spent hours on Graham Mayor's site, and Gregory Maxey's site, and then handed it over to my IT department, who assured me they would be able to come up with something. They just gave up, (which was about three weeks of wasted time, when my bosses wanted this completed yesterday.)

I am looking for someone to give me an idiot-proof walk-through of how to do this... as if you were explaining to someone who has zero macros experience...because that is true, here. I am using Word 2007. I really, really, really, really, really hope someone can help me!

Thanks so much in advance!
 
Joined
Aug 8, 2012
Messages
4
Reaction score
0
You need to supply a lot more info.

Is it the same places the text should appear? if they tick all 37 boxes, then is it the same place all the text should appear, or are there a place for each line? Is there a specific place for each of the 37 different things?

It shouldn't be hard to make with some VBA-coding, so I suggest you try to learn it. It's very intuitive. From your question it sounds like you just expect someone to code it all for you :)
 
Joined
Aug 13, 2012
Messages
2
Reaction score
0
Thanks for the response! No, I do not expect anyone to do all the work for me at all. I am just very in over my head on this. For instance, what is VBA coding, and how do I learn how to do that? Can you direct me to a link that would be helpful?

For your other question, I want the text to read as a list. For example, if all 37 checkboxes are ticked, I want it to read, "I like Apples, I like Oranges, I like Bananas, etc." But if only one box is checked, I just want it to read, " I like Apples."

So in that sense, the text based on which checkboxes are ticked will be all in one spot. However, I need that "one spot" to be replicated several places throughout the document.

Thanks so much again for responding. If you could point me in the direction of some resources so I can learn how to do this, it would be much appreciated! :)
 
Joined
Aug 8, 2012
Messages
4
Reaction score
0
If you write VBA introduction in either youtube or google, it's very easy to find good introduction to the matter.

Your specific problem should not be so hard. To get into VBA open a WORD-doc and push alt+f11. This opens the vba editor.
In the left side is the project explorer.
then for your document, there is a project. inside the project there is something called this_document and something called modules. These are places are places for code.

___________________

Then, the thing you want to do demands the use of a "form". so in your form you need 37 option boxes.
___________________

to put the code in the right places you can insert bookmarks in the word document. I can give you a hint on some code :

If docSkabelon.Bookmarks.Exists("bookmark1") = True Then

docSkabelon.Bookmarks("bookmark1").Range.Select

docSkabelon.Bookmarks("bookmark1").Range.Text = "I like apples."

End If

Before this you then need to put some code that recognizes whether the option box is ticked.
could be something like:

If CheckBox1.Value = True then.................. (not 100% sure about this code, you can find out on google)

And then you can do it for all your 37 boxes.

bookmarks are made in word by: insert -> bookmark and then you write the name you refer to in code.

I'm off on vacation now, I hope this gives you a hint in the right direction, good luck :)

Michael
 

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