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.

Word 2010

Discussion in 'Business Applications' started by rayd7024, Dec 8, 2011.

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

    rayd7024 Thread Starter

    Nov 22, 2011
    I have a Word 2010 document that contains three several ActiveX checkboxes. The checkbox names are CheckBox1 through CheckBox3. How do I set the Value of the checkboxes?

    I've tried the following however, it doesn't work.

    Sub ClearCheckBoxes()
    Dim numCheckBoxes
    numCheckBoxes = 3
    Dim chkBoxNum As Integer
    chkBoxNum = 3
    Dim chkBoxString As String
    Const constString = "CheckBox"
    For cnt = 1 To numCheckBoxes
    chkBoxString = constString & cnt
    ActiveDocument.FormFields.Item(chkBoxString).CheckBox.Value = False
    chkBoxString = ""
    Next cnt
    End Sub

    The macro that followw works; however, it comes with some baggage. If I delete one of the check boxes, the index changes and the macro no longer works.

    Sub ClearActiveX()
    Dim num As Integer
    num = 3
    For cnt = 1 To num
    ActiveDocument.InlineShapes(cnt).OLEFormat.Object = False
    Next cnt
    End Sub

    I'd really like to use the Sub ClearCheckBoxes() macro above, but can't figure out how to make it work.

    Any and all help will be greatly appreciated.
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!

Thread Status:
Not open for further replies.

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