Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2017, 11:20 AM
wlcdo2 wlcdo2 is offline Word VBA: ActiveX Controls Revert to Design Mode? Windows 7 32bit Word VBA: ActiveX Controls Revert to Design Mode? Office 2013
Novice
Word VBA: ActiveX Controls Revert to Design Mode?
 
Join Date: Jun 2016
Posts: 17
wlcdo2 is on a distinguished road
Default Word VBA: ActiveX Controls Revert to Design Mode?


Good morning,
I am working with Office 365, in particular Word version 1610 Build 7466.2038.

My Word document has a combination of ActiveX Combo Boxes and Check Boxes spread throughout. I'm having trouble though with the ActiveX controls, seemingly reverting to deign mode after macro has run - but according to the Toolbar, Design mode is definitely off. For example, one macro runs which populates a Combo Box with a list of customers, but then when I attempt to use the Combo Box, the drop down does not work but instead I can only select the control as if it were in Design mode i.e. the 8 grab handles appear. I then have to select DEVELOPER -> DESIGN MODE from the toolbar and toggle Design Mode on then off. My Combo Box then works.

This is all repeated however when I select my next ActiveX control.

I have stepped through my lines of code, but I can't understand why I have to keep toggling the Design Mode. Has anyone experienced this before?

Regards Corin.
Reply With Quote
  #2  
Old 01-23-2017, 02:22 AM
gmayor's Avatar
gmayor gmayor is offline Word VBA: ActiveX Controls Revert to Design Mode? Windows 10 Word VBA: ActiveX Controls Revert to Design Mode? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Surely you would be better using Content Controls for both the combo-boxes and the checkboxes rather than active-x elements? However check box content controls were only introduced with Word 2010 so it would depend on your target users.

Otherwise add the following to the end of your code

Code:
    If ActiveDocument.FormsDesign = True Then
        ActiveDocument.ToggleFormsDesign
    End If
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 01-23-2017, 11:15 AM
wlcdo2 wlcdo2 is offline Word VBA: ActiveX Controls Revert to Design Mode? Windows 7 32bit Word VBA: ActiveX Controls Revert to Design Mode? Office 2016
Novice
Word VBA: ActiveX Controls Revert to Design Mode?
 
Join Date: Jun 2016
Posts: 17
wlcdo2 is on a distinguished road
Default

Thank you Graham, really appreciate your advice. I think I do need to learn more about Content Controls. I chose Active-X controls because my organisation has a range of older and newer versions of Office & I guess I'm just a novice at VBA and found Active-x easier to programme (previous experience with Excel VBA).

Perhaps interestingly my document had been working fine for several months. I ended up trying the same document on my home PC last night (Office 2013) and it works just fine - so it almost seems like it's something with my laptop?

I also tried your code but after the full code ran once, the Checkbox was still behaving oddly. The document definitely isn't in design mode, but I still have to manually toggle Design mode to be able to un-check the box and run the code. Other Checkbox's, don't think seem to have the problem. The other seemingly odd thing is that if I test multiple times, then it seems to 'behave'.

If I was to convert to Content Controls, one of the current actions for some checkboxes is to check the value of other checkboxes and it they're not checked, then the code will check them then run the code assigned to that next Checkbox. I can do this easily with Active-X but I couldn't get it to work with CC's. Would you be able to offer some advice on this to get me in the right direction?

Regards Corin.
Reply With Quote
  #4  
Old 01-23-2017, 10:26 PM
gmayor's Avatar
gmayor gmayor is offline Word VBA: ActiveX Controls Revert to Design Mode? Windows 10 Word VBA: ActiveX Controls Revert to Design Mode? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

My old friend Greg Maxey has lots of assistance on content controls on his web site - start with http://gregmaxey.com/word_tip_pages/...om_events.html.

In the meantime, try repairing Office on your laptop and see http://www.gmayor.com/what_to_do_when_word_crashes.htm.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Everything in document went invisible after adding ActiveX controls Quantum Flux Word VBA 0 01-18-2017 06:44 PM
Word VBA: ActiveX Controls Revert to Design Mode? ActiveX controls on Worksheet stopped working Johauuez Excel Programming 10 12-12-2014 08:57 PM
Need help with placeholder text in ActiveX controls in Word mhellerstein Office 0 11-02-2011 12:31 PM
Word VBA: ActiveX Controls Revert to Design Mode? Form protected in design mode-can't do anything DrDtMM Word VBA 12 01-23-2011 12:37 PM
ActiveX controls inserted on a template do not function well ged Word 0 10-21-2010 04:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft