Hyperlink macro assigned to checkbox form field

J

Jack_Feeman

I have read a lot of great ideas on similar issues but not exactly this one.
In a protected Word Form, we want to add a "continue" check box in a table
cell to allow the form user to 'continue" the input of a cell by clicking a
checkbox that takes him/her to another page where they can continue that item
and click a macrobutton to return them to the cell they were previously in.

I recorded a macro to select the Goto>Bookmark>{bookmark name}
In the Checkbox properties I assigned this maco to the "Run Macro on Entry"
field.

I assumed that when the checkbox was clicked, the form control would run the
macro assigned and the user would be taken to the bookmark.

Unfortunately, I was wrong. It sits there and does nothing with the form
locked. If I unlock the form (but still not in design mode) or with the form
unlocked and in design mode, it simply sits there.

What do I do to make the macro run?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SmFja19GZWVtYW4=?=,

Which version of Word is this? There are a couple of versions of Word, with no
SP / SR installed, where the "On Enter" functionality doesn't fire if you use a
mouse to navigate the form fields.

In any case, it's never going to work exactly as you imagine, because On Enter
and On Exit mean exactly that: they fire when the field gets or loses the focus.
There is no "Click" event for form fields. An ActiveX checkbox, from the
Controls Toolbox, could provide this, though.
I have read a lot of great ideas on similar issues but not exactly this one.
In a protected Word Form, we want to add a "continue" check box in a table
cell to allow the form user to 'continue" the input of a cell by clicking a
checkbox that takes him/her to another page where they can continue that item
and click a macrobutton to return them to the cell they were previously in.

I recorded a macro to select the Goto>Bookmark>{bookmark name}
In the Checkbox properties I assigned this maco to the "Run Macro on Entry"
field.

I assumed that when the checkbox was clicked, the form control would run the
macro assigned and the user would be taken to the bookmark.

Unfortunately, I was wrong. It sits there and does nothing with the form
locked. If I unlock the form (but still not in design mode) or with the form
unlocked and in design mode, it simply sits there.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SmFja19GZWVtYW4=?=,
Its 2003. I used the control toolbox checkbox first, then read of all the
trouble of getting hyperlinks to run in a protected form, so when I saw the
run macro on Entry, I thought my problems were solved. On Entry sure looked
like it meant on entry (clicking the checkbox).

My Word VBA is very limited, so inserting the toolbox checkbox control into
the document, double clicking it to bring up the editor, and inserting ..(and
I jave no idea what to add)..... into the code will do it? Or do I also have
to use section breaks to separate it from the protected parts of the document?
Controls from the Control toolbox work in protected sections, as long as
they're formatted to be in line with the text (no graphical textwrap
formatting). So no need to include a section break just for that :)
Now for the return trip, anyone know how to code a command button to return
the user to the last point of reference on click.
I'd have the code that "jumps" note the calling location in a document
Variable (ActiveDocument.Variables("name") = "info"). Then the code to "jump
back" reads that variable and moves to that location.

Since you're mixing form field and ActiveX controls, you'll probably need to
store whether the point of origin is a form field or an ActiveX control. To
get an ActiveX control you need to query the InlineShapes collection. And, in
this case I'd place a bookmark AROUND that control so that you can do
something like this
ActiveDocument.Bookmarks("Checkbox").Range.InlineShapes(1).Select

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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