You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Office JavaScript API在Office 365中通过Base64创建文档失败咨询

关于Office 365网页版不支持通过Base64创建Word文档的问题

我使用以下代码在Word桌面版中可通过Base64字符串创建新文档,但在Office 365网页版中无法运行,报错信息为:

The action isn't supported by Word in a browser

想咨询该功能是否暂不支持Office 365网页版?

async function CreateNewDoc(event) {
    try {
        await Word.run(async (context) => {
            // Use the Base64-encoded string representation of the selected .docx file.
            const externalDocument = base64;
            var externalDoc = context.application.createDocument(externalDocument);
            await context.sync();
            externalDoc.open();
            event.completed();
            await context.sync();
        });
    } 
    catch (error) {
        event.completed();
        console.error(error);
    }
}

附报错截图:
报错信息截图

内容的提问来源于stack exchange,提问作者user22905514

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 04:19:52