文档自定义属性未保存在Windows的Office 365中 [英] Document custom properties not save in Office 365 for Windows

查看:154
本文介绍了文档自定义属性未保存在Windows的Office 365中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Office js Word加载项代码将自定义属性保存到文档customproperty集合.保存代码如下

My office js Word add-in code saves a custom property to the document customproperty collection. The code for saving is as below

    Word.run(function (context) {
        //method accepts property name plus value
        context.document.properties.customProperties.add(propertyname, value);
        return context.sync()
            .then(function () {
                console.log("Property saved");
            })
            .catch (function (e) {
            console.log("Error occured inserting property " + e.message);

        });
    });

当我使用Office 365 for Windows(Word桌面)创建文档并调用我的外接程序时,属性未保存到自定义属性集合中.但是,使用Office Online创建文档时会保存属性.我修改了代码以包含document.save,但没有区别.在Windows的Office 365中设置的此要求是否有任何限制.我在版本1803(内部版本9126.2275,即点即用)上运行.

When I create the document using Office 365 for Windows (Word desktop) and invoke my addin the properties are not getting saved into the custom properties collection. However the properties get saved when the document is created using Office Online. I amended the code to include a document.save but it makes no difference. Is there any limitation with this requirement set in Office 365 for Windows. Im on version Version 1803 (Build 9126.2275 Click-to-Run).

在Office 365 for Windows中,当我单击信息"->属性"->高级属性"->自定义"时,甚至可以看到自定义属性.但是,由于某些奇怪的原因,自定义属性没有保留在文档中,而当我重新打开文档时,它们丢失了.这看起来像Office 365 for Windows中的API的错误.当我们通过代码向集合中添加自定义属性时,该属性不会保存到文档中.即使我们在上下文调用之前包含document.save,自定义属性也不会通过代码保存到文档属性集合中.因此,我通过代码将自定义属性插入到文档中,然后单击"Word"菜单上的保存"按钮.但是,这也没有将自定义属性保存到文档中.我可以将自定义属性保存到文档中的唯一方法是在文档中插入一些文本,然后单击菜单上的保存"按钮.

In Office 365 for Windows I can even see the custom property when I click on Info->Properties->AdvancedProperties->Custom. However for some odd reason the custom properties are not getting persisted in the document and when I reopen the document they are missing. This looks like a bug with the API in Office 365 for Windows. When we add a custom property to the collection via code it is not getting saved into the document. Even if we include a document.save before the context call, the custom property is not getting saved into the document property collection via code. So I inserted the custom property into the document via code and then hit the save button on Word menu. However this also did not save the custom property into the document. The only way that I can get the custom property to save into the document is by inserting some text into the document and hitting the save button on the menu.

推荐答案

感谢您报告此问题.我实际上试图在引用的版本上对其进行复制,但我不能.实际上,我们现在存在一个错误(已知问题),当您保存自定义文档属性并保存文档时,该文档会保持脏状态,这意味着系统将提示用户再次保存该文档(即使在创建属性后)并使用用户界面保存文档).

Thanks for reporting this issue. I actually tried to repro it on the cited build but I am not able to. There is actually a bug we have right now (knwon issue) that when you save custom doc properties and save the document, the document keeps a dirty state, meaning the user will be prompted to save the document again (even if after creating the properties and saving the doc using the UI).

虽然没有数据丢失,只是弹出是否要保存更改?"对话框在给定文档已被保存的情况下确实没有任何意义,但是我观察到的是,即使用户选择不保存该对话框,该属性仍然会保留.

there is no data loss though, just a pop of a "Want to save changes?" dialog that really does not make sense given the doc was explicitly saved but what i observed is that the even if the user selects to not save on that dialog, the properties are still persisted.

这篇关于文档自定义属性未保存在Windows的Office 365中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆