none
Issue with activex persistency in office 365 RRS feed

  • Question

  • Hello Everyone,

    I have an issue the usage of ActiveX in Word 365.
    I can copy/paste the ActiveX control onto Word 365 but when I apply a save / load actions, it does not work as expected.
    Based on the animation video showing the effect, you will see the document save works as expected and invoke the IPersistStorage::Save method but when I decide to apply a file open document, it directly performs a IPersistStorage::Save and not a IPersistStorage::Load to retrieve the saved settings. Currently the effect is an activeX control attached to the document with his default settings.

    The effect can be demonstrated here:
    Effect on open document document

    The code related to the IPersistStorage interface is visible here:
    Persist.cpp

    The code related to the main body of the activeX control maybe be visible here:
    MFCActiveXControl1Ctrl.cpp

    The entire project to repeat on your end is downloadable here:
    Entire project

    I would like to know if somebody has already discovered the same issue and why IPersistStorage behaves differently and what is the new concept to use to be compatible with the new Office 365 package (Word / PowerPoint mainly).

    Thank you very much in advance.
    Best regards.
    MiQi

    What I have tried:

    I have seen the docx format is not a compound file anymore.
    If you rename the docx by zip, it will contain a folders tree with an ActiveX section.
    This is strange IPersistStorage is still called but not behaving as expected.
    Monday, October 8, 2018 2:54 PM

All replies

  • Hi,

    Based on your description, I find its mainly related to code. To better resolve the issue, I will move it to Word for Developers forum.

    Thanks for your understanding!

    Best Regards, 

    Herb Gu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Microsoft Team

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams


    Tuesday, October 9, 2018 7:20 AM
  • Hello Mr Herb Gu,

    How do you know it is related to VBA code ?

    I have written the activex control from Visual Studio 2017 in MFC / c++.

    I just need to know how and why the activex control I just freshly made cannot persist his settings inside Word 2016/365 or PowerPoint 2016/365 page container.

    I assume there should be something modified / changed inside the ocx to be compatible with the new way the container is calling the appropriated interface.

    I hope you will be able to assist me. 

    Thank you very much in advance.

    Best regards.

    MiQi

    Tuesday, October 9, 2018 8:43 AM
  • Some observations:

    Debugging OCX controls in VS is an unfamiliar area for me - if you have the code for your test framework as well, that would be helpful. But have you used exactly the same test approach with previous versions of Office with no problems?

    Because what I *could* do here was build the OCX, then

    a. go into Word's Developer tabeand insert the OCX directly

    b. save the document as a .docx, close the document, and re-open the document. 

    That worked OK and there were no exceptions. To confirm that OCX properties were being preserved, I

    c. reopened the document, modified the width property in the Developer tab's Properties pane, saved, and reopened. No problems, and the shape was preserved.

    That was all done with 32-bit Office so I had to build the 32-bit version of the OCX. 

    If you do that on your test system, do you see problems? If so, could it be a 64-bit problem only (I cannot test that here)?



    Peter Jamieson

    Tuesday, October 9, 2018 12:44 PM
  • Hi supermip,

    Sorry, this is not the technical range we support. 

    You could refer to Peter's reply. Here is about the AtiveX control article, please review the following link:

    Using ActiveX Controls on Word Documents

    Best Regards,

    Lina


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Wednesday, October 10, 2018 9:22 AM