Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Nov 2003
    Location
    Kennett Square, Pennsylvania, USA
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Duplicating a checkbox (Office 2003 SP1)

    Is there a way of duplicating the results of user input on a checkbox? For example, if the user checks a checkbox in one part of the document, can I get word to automatically check a checkbox in another part of the document?

    I have tried naming the checkboxes the same but this does not seem to help. I have also tried inserting reference/bookmarks in the second part of the document where I want the checkbox to be duplicated, but that does not help either.

    The reason for this is that many of the letter templates have to be sent in two languages (English/Spanish) and so in order to avoid having the user duplicate the form fields on the Spanish version of the document, we just want to copy all user input from form fields, including checkboxes, to the translation. All other form fields can be made to work except checkboxes.

    Thanks for any comments.

    Bill

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

    Re: Duplicating a checkbox (Office 2003 SP1)

    Activate the Visual Basic Editor (Alt+F11)
    Insert a new module (Insert | Module)
    Copy the following code into the module and substitute the correct names of the check boxes (i.e. their bookmark names, as shown when you double click a check box while the document is unprotected)

    Sub UpdateCheckBox2()
    ActiveDocument.FormFields("CheckBox2").CheckBox.Va lue = _
    ActiveDocument.FormFields("CheckBox1").CheckBox.Va lue
    End Sub

    Switch back to Word.
    Double click the first check box ("CheckBox1" in the code).
    Click in the Exit box and select UpdateCheckBox2 from the dropdown list.

    Protect the document for forms to test. The second check box will be updated when the user tabs out of the first one, not when the user clicks in the first one.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2003
    Location
    Kennett Square, Pennsylvania, USA
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duplicating a checkbox (Office 2003 SP1)

    Hans,

    Many thanks. This worked. I wonder why word doesn't provide a similar process so the user does not have to revert to VB code.

    Bill

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

    Re: Duplicating a checkbox (Office 2003 SP1)

    Bookmarks always refer to text, so they cannot be used for this purpose.
    It would be hard for Microsoft to provide for every possible wish; that's why there is a powerful macro language.

Posting Permissions

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