Clicking in the box to place the X does not trigger the macro. Pressing
the TAB key to move to the next form field triggers the macro.
-Jim
--
Jim Gordon
Mac MVP
Co-author of Office 2008 for Mac All-in-One For Dummies
http://tinyurl.com/Office-2008-for-Dummies
You are still coding "If Check1 = True"
It always will be True, because Check1 is the checkbox control itself. That
contains something (a checkbox) so it's value is NOT "nothing" and
therefore, is true always.
You need to say "If Check1.Value = True then" which tests the Value property
that Check1 contains. That will toggle between True and False depending on
what the user does. Check1 has several other properties as well: for
example, its name. But there is only one .Value.
Did you look at the examples I referred you to?
Cheers
On 22/12/09 10:51 PM, in article 59baf...@webcrossing.JaKIaxP2ac0,
"ron...@officeformac.com" <ron...@officeformac.com> wrote:
This email is my business email -- Please do not email me about forum
matters unless you intend to pay!
--
John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:jo...@mcghie.name
Hi Ron,
When you are in the VB Editor the help files that are available are
different from when you are not int he VB editor. Here's a slight
modification of your code blended with the example provided by the Help
in the VB Editor. This code works when I press the Tab key while the
form is protected for forms. The default setting for Check1 is not
checked (set this in the form's dialog box before protecting the form).
Adjust the true/false logic as desired. I used different bookmark names
from yours for no reason in particular - just felt like it.
Sub HandleCheckbox()
Dim Check1, Same, MyField
Set MyField = ActiveDocument.FormFields("Check1").CheckBox
If MyField.Default = MyField.Value Then Same = True
If Same = True Then
'skip over Text3 and go to Text4
Selection.GoTo What:=wdGoToBookmark, Name:="FirstBookmark"
MsgBox "FirstBookmark selected"
Else
'checkbox not checked; do not skip over Text3
Selection.GoTo What:=wdGoToBookmark, Name:="SecondBookmark"
MsgBox "SecondBookmark selected"
End If
End Sub
Flip me a copy of the document you're working in, and the template you have
the macro in. I'll take a look for you. Email in the .sig
(not: Plain text email with attachments: no urls or you won't make it
through the spam filter...)
You're getting "out of context" errors which means you either have the macro
in the wrong place, or defined as Private when it should be Public.
VBA in Word is VBA in Word, regardless of the platform. It's just that not
all of it "works" on the Mac (but it is supposed to...)
Cheers
On 23/12/09 11:09 PM, in article 59baf...@webcrossing.JaKIaxP2ac0,