在Word文档中保存和读取powerBI属性

时间:2020-07-13 09:45:26

标签: c# .net powerbi word

我们如何向Word文档添加新属性,例如将工作区ID添加到Word文件的属性中?目前我有这个:

Word.Document document = WordApp.ActiveDocument;
Microsoft.Office.Core.DocumentProperties properties;
properties = (Microsoft.Office.Core.DocumentProperties)document.CustomDocumentProperties;
properties["workspace"].Value = "myNewWorkspace";
document.Save();

要读取属性,只需列出所有属性并按字段进行过滤,在这种情况下,请检查我认为的properties["workspace"].Value(根本不做和测试),如果有人有任何想法或实现,那将会很好。

0 个答案:

没有答案
相关问题