简体   繁体   English

在Word js加载项中使用宏(.docm)打开Word文档

[英]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. 我有应该下载并打开其他Word文档的Office js加载项。 It works fine except documents containing macros (.docm). 除包含宏(.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. 问题是,在那之后我有2个Word窗口。 Document1 - is where I press the button to open the doc. Document1-是我按按钮打开文档的地方。 And Document2 with the downloaded document. 和Document2一起下载的文件。 BUT, the message "SECURITY Warning. Some active content has been disabled. Click for more details" is shown in the Document1 window. 但是,Document1窗口中显示消息“安全警告。某些活动内容已被禁用。单击以获取更多详细信息”。 And when I click "Enable Content" nothing happens. 当我单击“启用内容”时,没有任何反应。 Onopen macro in document2 is not running. document2中的Onopen宏未运行。 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! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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