简体   繁体   中英

Open Word document with macro (.docm) in Word js add-in

I have Office js add-in that should download and open other Word documents. It works fine except documents containing macros (.docm). Here is the code:

function loadSampleData() {
    Word.run(function(context) {
    var myNewDoc = context.application.createDocument(base64documentdata);
    myNewDoc.open();
    return context.sync();
});

The problem is, that after that I have 2 Word windows. Document1 - is where I press the button to open the doc. And Document2 with the downloaded document. BUT, the message "SECURITY Warning. Some active content has been disabled. Click for more details" is shown in the Document1 window. And when I click "Enable Content" nothing happens. Onopen macro in document2 is not running. If I try to enable macros using Developer tab it does not work either. If I open the same downloaded document manually, macros work fine. Is there any workaround for this?

yes this is a bug and we are working on a fix. thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM