Results 1 to 13 of 13
  1. #1
    New Lounger
    Join Date
    Apr 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Check box form feild (word 2000)

    In need of assistance with a change I wish to make to Word 2000 and one of the form feilds available to use in documents. See attached document.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Check box form feild (word 2000)

    You can't change the text box form field. But you can create other kinds of clickable check boxes - see for instance Charles Kenyon's download page; look for "check box add-in".

  3. #3
    New Lounger
    Join Date
    Apr 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    Yes I was aware of this site. However the Add-ins here are for a global template. What i want to do is be able to use this in an independent document. What I had hoped was to be able to locate the macro responsible for the Standard Word check box and edit it.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Check box form feild (word 2000)

    What you want is not possible; the code behind form fields can't be edited or overruled by a macro.

  5. #5
    New Lounger
    Join Date
    Apr 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    Hans
    I have seen various forms with these types of check boxes in them, I have a .pdf document which has these added. How are these added ?

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    Display the Forms Toolbar: View | Toolbars | Forms.

    Insert these form controls using the buttons on this toolbar.

    The macrobutton field is inserted via the Fields list: Insert | Fields | Macrobutton.

    You'll notice that Macrobutton takes 2 arguments: the macroname and displaytext.
    In your document, the macroname is UnCheckit and the displaytext is simply a
    character from the wingdings font. In you document, no code exists behind the
    Uncheckit button. If you create a sub called uncheckit, you'll put some action to the
    button:
    Sub Uncheckit
    msgbox "Hey, there."
    end sub

    Remember too, to unprotect the "form" (the document) before working on your
    form controls, and protect the form in order to test or use the controls. Make sense?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  7. #7
    New Lounger
    Join Date
    Apr 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    Makes sense. But I am lost as to how to make the action of check - uncheck occur.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    Well, the display text of a macrobutton field is static. What you see is what you get.
    Maybe some programming trick could give the effect of checking and unchecking
    by replacing that displaytext, but I don't know how to do it.

    The other checkbox -- on the Forms toolbar -- works the way you want: Click it's checked,
    click again it's not. I suspect you dislike the X and want the check mark instead. Not sure
    if you can get that.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Check box form feild (word 2000)

    > I have seen various forms with these types of check boxes in them, I have a .pdf document which has these
    > added. How are these added ?

    Acrobat has a different toolset than Word.

    I wonder if you could program something like an HTML document where a graphic is click-sensitive and changes back and forth when clicked. Off the top of my head, I can't think of a way to make that work in a Word document. The MACROBUTTON field can contain a bitmap, but it requires double-clicking to activate the code. They also don't behave very well in protected documents because they don't like to keep the keyboard focus. As far as I know, there's no way to make a hyperlink run a snippet of code (as you can in an HTML document). Tough one.

    Updated after reading Charles Kenyon's document

    Whoa, you can make MACROBUTTON fields fire with a single click after all:

    Sub AutoOpen()
    ' Set macro button response to one click rather than double-click
    ' Macro written by Charles Kenyon based on help from Bill Coan on newsgroup
    '
    Options.ButtonFieldClicks = 1
    '
    End Sub

    Okay, so this is the solution, but only if you distribute a template because it uses AutoText, which cannot be stored in a document. Charles mentions at the end of the document that he's working on an alternative approach that would solve this, and also says you could figure it out from an article he links to:

    Enable a user to double-click text in a document to change its value

    This approach uses a single MACROBUTTON field triggering a single macro. The macro checks the internal code of the field and swaps the exising display text to a different character. All you need to do is borrow this code, figure out the character code for your checked and blank checkboxes, and make a couple of changes. As long as the field in the document is set to display in Wingdings or whatever font you're using (Symbol is likely to get you in trouble, you don't want that character set), it should work. Cool.

    Hans, thanks for the great reference!

  10. #10
    New Lounger
    Join Date
    Apr 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    Yes Jsche2000 i was aware of this however I have emailed Charles and have not recieved a reply in 2 weeks. Assume he is unsuccessful or hasn't completed yet.
    Using the macro in this way does not leave me with the independant document I want. That is able to be used on a PC without the template present.

  11. #11
    New Lounger
    Join Date
    Apr 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    My apologies, a case of RTFM. Will go do some further reading and see if I can figure it out. I am a relative newbie to VBA hence the seemingly dumb approach.

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Check box form feild (word 2000)

    Are you aware that you can save macros in Word documents? Simply press Alt+F8, type a macro name, and then in the drop-down, choose the document, and click Create. The Visual Basic editor will open, and you will be creating a macro that will be saved in your document.

    If this is news to you, you might benefit from further study of the VBA documentation before dismissing the suggested solution.

  13. #13
    New Lounger
    Join Date
    Apr 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check box form feild (word 2000)

    Just wanted to complete this thread. I solved the problem by simply converting the form I had written in word to.pdf and using Acrobat found all the form tools I needed ready to go !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •