none
ActiveX Controls changes its shape and behaviour randomly and become use less RRS feed

  • Question

  • Hi,

    I am using many ActiveX Controls like check boxes, buttons and textboxes in my document (in both MS Word 2007 and 2010).

    I've noticed that sometimes randomly these controls change as following:

    1) they either change their shape and type; they change into a big square shape and looses all its properties and events and now they are no longer the same controls. 

    2) on clicking this new "shape" it shows the "Design Mode" handle not the normal control focus handle

    This issue does not occur for all the controls at the same time but it occurs to 1 or 2 controls randomly and at random times.

    I've seen this happen when the document is closed and then re-opened.

    Please advise how to solve this issue.

    Thanks

    Wednesday, August 21, 2013 7:37 AM

Answers

  • It appears that the ActiveX controls no longer "know" that they're ActiveX controls - the functionality has been "unlinked" from the Shape or InlineShape object that represents the control on the document surface. This is usually a sign that the document's internal structures have been damaged.

    There really isn't a way to "solve" this problem, except, possibly, to recreate the document and probably use something else than ActiveX for all your form controls.

    ActiveX controls were designed to be used in VBA forms. They aren't "native" to Word and Word documents weren't really designed to host "many" ActiveX controls. ActiveX controls use "object linking and embedding" (OLE) to provide the code functionality on the document surface. Word isn't designed to manage "many" OLE interfaces at a single time.

    You should look at using content controls or form fields as data entry points, where possible. There's also a MacroButton field code that could be used in place of an ActiveX command button.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, August 21, 2013 10:01 AM
    Moderator
  • http://office.microsoft.com/en-001/word-help/field-codes-macrobutton-field-HP005186171.aspx

    http://support.microsoft.com/kb/78835

    http://word.mvps.org/FAQs/tblsfldsfms/usingmacrobutton.htm

    http://www.gmayor.com/macrobutton.htm

    Note: by default, the field is activated by a double-click, as is mentioned in the articles. But Word has the Application.Options.ButtonFieldClicks property to which you can assign the value 1 (one) so that a single click will activate the button. I put this in the AutoNew, AutoOpen or whatever that triggers when a document is opened/created.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, August 22, 2013 3:16 PM
    Moderator

All replies

  • It appears that the ActiveX controls no longer "know" that they're ActiveX controls - the functionality has been "unlinked" from the Shape or InlineShape object that represents the control on the document surface. This is usually a sign that the document's internal structures have been damaged.

    There really isn't a way to "solve" this problem, except, possibly, to recreate the document and probably use something else than ActiveX for all your form controls.

    ActiveX controls were designed to be used in VBA forms. They aren't "native" to Word and Word documents weren't really designed to host "many" ActiveX controls. ActiveX controls use "object linking and embedding" (OLE) to provide the code functionality on the document surface. Word isn't designed to manage "many" OLE interfaces at a single time.

    You should look at using content controls or form fields as data entry points, where possible. There's also a MacroButton field code that could be used in place of an ActiveX command button.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, August 21, 2013 10:01 AM
    Moderator
  • Thanks Cindy.

    That was a new insight into Word.

    I don't have any idea about the "MacroButton" field. Can you give a brief introduction to this?

    Thanks.

    Thursday, August 22, 2013 11:02 AM
  • http://office.microsoft.com/en-001/word-help/field-codes-macrobutton-field-HP005186171.aspx

    http://support.microsoft.com/kb/78835

    http://word.mvps.org/FAQs/tblsfldsfms/usingmacrobutton.htm

    http://www.gmayor.com/macrobutton.htm

    Note: by default, the field is activated by a double-click, as is mentioned in the articles. But Word has the Application.Options.ButtonFieldClicks property to which you can assign the value 1 (one) so that a single click will activate the button. I put this in the AutoNew, AutoOpen or whatever that triggers when a document is opened/created.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, August 22, 2013 3:16 PM
    Moderator