Word 2013 and ActiveX checkbox controls- weird behavior

Saw this posted before but no resolution given (I saw a resolution involving document protection but trying that just broke stuff worse), feel free to point me to an existing solution if there is one.

I created a document in Word 2010. It is basically a guided process document: a few pages of text, then the ActiveX checkboxes which call some VB script that toggles blocks of text later in the document, between being formatted as hidden or not. Short story, I want the document to guide users through a set of tasks, with different tasks being relevant or not relevant depending on the input in those checkboxes.

Word 2010: works great, saves us acres of time every time we need to do this task!

Word 2013: initially works great but after selecting some of the  checkboxes then scrolling through the document and returning to the checkboxes, they no longer work. The dotted-box outline of the checkbox object is "normal" (faint dotted line) when it's working, and looks like the developer mode boundary when it is not working (darker dotted line with boxes on the corners).  If you close the document (with or without saving) OR toggle into developer mode then back out, the checkboxes work again for a while but break again.

The code behind the checkbox is very basic:

Private Sub CheckBox1_Click()

If CheckBox1.Value = False Then
        ActiveDocument.Bookmarks("BK_text1").Range.Font.Hidden = True
Else
        ActiveDocument.Bookmarks("Bk_text1").Range.Font.Hidden = False
End If

End Sub

One routine per checkbox and each calling a different bookmark.

I understand from other posts that the ActiveX controls will be deprecated at some point in the future but they are not yet deprecated (that I know of) as I can still create new ones, so I would really like to make this work.  I can always recreate the document using a different control but it's about 90 pages long, very complex, lots of boxes and bookmarks--- not a small undertaking and I need to be able to use this doc in 2010 and 2013 in the mean time.

Also I know it is not my instance of Word because I've used multiple machines to test, and also it is not the doc itself because I created a brand new one which is much shorter and exhibits the same behavior.  The only thing copied from old doc to new is the snip of code above.  

Any takers?

How about using Content Control Text Boxes and the ContentControlOnExit event to take the necessary action, depending upon the .Tag of each Content Control and its .Checked status.

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim cc As ContentControl
With ActiveDocument
    For Each cc In .ContentControls
        If cc.Tag = "Check1" And cc.Checked = True Then
            .Bookmarks("Check1").Range.Font.Hidden = True
        Else
            .Bookmarks("Check1").Range.Font.Hidden = False
        End If
        If cc.Tag = "Check2" And cc.Checked = True Then
            .Bookmarks("Check2").Range.Font.Hidden = True
        Else
            .Bookmarks("Check2").Range.Font.Hidden = False
        End If
    Next cc
End With
End Sub

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

This may be caused by the latest MS Office updates, which have broken the functionality of ActiveX controls. the offending updates are:
KB2596927 for Office 2007
KB2553154 for Office 2010
KB2726958 for Office 2013
Uninstalling these updates restores ActiveX functionality. In your case, it's possible the updates haven't yet been applied to the PCs on which the ActiveX controls are still functional.
Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

You do not have to uninstall updates anything.

This is a link to bat file fixed ActiveX problems in Excel and Word

In this file you can find this line:

@del "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Forms\*.exd" /s
@del "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Forms\*.exd" /s
@del "C:\Users\%USERNAME%\AppData\Local\Temp\Excel8.0\*.exd" /s
@del "C:\Users\%USERNAME%\AppData\Local\Temp\VBE\*.exd" /s 
@del "C:\Users\%USERNAME%\AppData\Local\Temp\Word8.0\*.exd" /s

I's safe to use with no admin rights

Regards

- - -
MVP Office Dev 11-24, 3xMCC
Jeśli post odpowiada na Twój problem, zaznacz go dla innych szukających rozwiązania!
Szukasz automatyzacji działań? Polskie dodatki do Office: http://www.VBATools.pl

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Rewriting the controls is probably the long-term solution but I need to look for a decent work-around or other fix first.  Rewriting the controls on this particular project is going to be a long process and I have to prioritize it along with about a million other projects I have, and I have to at least try to make things usable while that happens. So I'm going to hang on to this approach till I exhaust all other avenues.  I'm basically the sole caretaker of this process document and if there's simply no other way to get around the issue, I'll put everything else on the back burner, but if I can kluge a work-around then I can finish my other stuff and circle back to this later.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

This might be the issue. I didn't see the hotfix in my control panel but checked the patch contents for file versions based on one of the KB about the hotfix, and I've got a more recent version, hence I'm guessing the potentially problematic hotfix has been bundled with something more recent. 

I did see another thread about this hotfix and this functionalty and will subscribe to see if there's any updates.  Can anyone share if this is on the radar to be fixed?

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Unfortunately this was just a short-term fix. Fixed a few of the problematic machines temporarily but when I asked users to really lean on it and try to break it, the issue returned.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 2,043 Applies to: