Macro doesn't copy along with Word doc

J

Jay

Greetings! I have a macro in a Word 07 document which allows a user to pick
only one check box from a group of three. I turned on protection, checked
that the macro was working (which it was), and then saved the doc. I used a
file administration/distribution software to send the doc to multiple users.
When the users opened the doc, the macro was not there. Is there a way to
get a macro to copy along with a doc?

Thanx,
 
G

Graham Mayor

You need to save the macro in the document rather than in your normal
template. Your next problem will be persuading users to run macros contained
in a document.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Jay

Is there a setting or something I need to do in order to specify where the
macro gets saved? I must be missing something easy here...

Thanx again,
 
J

Jan Hyde (VB MVP)

Jay <[email protected]>'s wild thoughts were
released on Wed, 29 Oct 2008 06:01:01 -0700 bearing the
following fruit:
Greetings! I have a macro in a Word 07 document which allows a user to pick
only one check box from a group of three. I turned on protection, checked
that the macro was working (which it was), and then saved the doc. I used a
file administration/distribution software to send the doc to multiple users.
When the users opened the doc, the macro was not there. Is there a way to
get a macro to copy along with a doc?

Could you not avoid the need to write a macro to make
checkboxes work like option buttons by using option buttons,
or even a combo box?
 
J

Jay

Thank you for your help. This info is good as far as getting the macro
installed, but when I click Run, errors appear, and the debugger isn't
telling me much...the macro works on my machine the way I want it to, but
it's just being a pain. Can you suggest a resource for help with the
debugger? The code looks ok to me...

Thanx
 
J

Jay

That sounds good as well, but I'm not that good (yet). Could you point me in
the direction of a good tutorial for how to do that? I was trying to get
into learning fields, macros, etc., but if you read my last post to Graham
Mayor, it's turning into one of those cans of spring-loaded snakes...

Thanx,
 
J

Jay

Hey, Jan. Could you recommend a good site or other tutorial which could help
me with these possibilities?

Thanx,
Jay
 
J

Jay

Hey there! I tried your suggestion about using option buttons, but now I
have a new issue. I created a multiple choice test for my students, with 4
options per question. I put the four option buttons for each question in a
frame, so that only one option may be chosen for each question. Works great
for question #1...when I try to answer question #2, the choice from the first
question disappears altogether. Same thing when I try to answer #3. Any
ideas?

Thanks,
 
D

Doug Robbins - Word MVP

You don;t need the frame, but you need to assign a different group name to
each group of four option buttons. All buttons with the same group name
will then behave as you want.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jay

Ok...must be something simple I'm missing here. I removed the frame from the
first two groups of four. In Design mode, I selected the first four option
buttons and chose Group from the Controls group. I couldn't find a place to
name the group. I did the same thing for the second four buttons, and when I
tried to test it, I got the same result. As I said, there must be something
obvious I'm not getting...

Thanx,
Jay
 
D

Doug Robbins - Word MVP

When in design mode, right click on the control and select properties and in
the properties dialog you will see a GroupName attribute for which you can
enter the name of the group

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jay

Excellent! Thank you so much!! As I said, it was something small I was
overlooking...I had already been inside the Properties to set the caption,
font, and size...also had to reset value to False after forgetting to turn on
Design Mode...completely missed the GroupName filed. Works like a charm!

One more question, if I may, and then I'll leave you alone: originally I
tried to do this with checkboxes. I tested them using the method you taught
me, but all four were checked. I looked at the kinds of properties of the
checkboxes and the option buttons, and they looked the same. Why wouldn't
they behave the same? They just appear to be either true/false, and I did
give the checkboxes group names.

Thanks again
 
D

Doug Robbins - Word MVP

I am not sure what you mean by "using the method you taught me", but Active
X check boxes do not work that way and you need to use radio buttons if you
want only one of a group to be checked at a time.

When using formfields as are used in the document that is protected for
forms, as there is no radio button type formfield, you had to use a macro to
get formfield checkboxes to work like radio buttons.

If you insert each group of check boxes into a cell in a table, and you set
a
macro containing the following code to be run on entry to each of the check
boxes, they will behave in the way that you want:

Dim oField As FormField
For Each oField In Selection.Cells(1).Range.FormFields
oField.CheckBox.Value = False
Next oField
Selection.FormFields(1).CheckBox.Value = True


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - 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