1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: ActiveX Checkbox

Discussion in 'Business Applications' started by rayd7024, Nov 22, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. rayd7024

    rayd7024 Thread Starter

    Joined:
    Nov 22, 2011
    Messages:
    3
    I inserted an ActiveX checkbox into a Word 2007 document. I accepted the default name of CheckBox1 for the check box. I created a macro to set the checkbox value to false as follows:
    Sub SetCheckBox()
    ActiveDocument.FormFields.Item("CheckBox1").CheckBox.Value = False
    End Sub

    When I run the macro, I get the following error:
    Run-time error '5941': The requested member of the collection does not exist.

    Can anyone shed some light on the problem and possible solution.
    Any and help will be greatly appreciated.
     
  2. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,732
    Try using the .InlineShapes collection instead. Just replace the number 1 with the index number of your actual control.

    Code:
    ActiveDocument.InlineShapes(1).OLEFormat.Object.Value = False
    Rollin
     
  3. rayd7024

    rayd7024 Thread Starter

    Joined:
    Nov 22, 2011
    Messages:
    3
    Thanks!
    It works like a charm.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1028008