gpt4 book ai didi

c# - Word VSTO - 向 Word 文件添加标签

转载 作者:太空宇宙 更新时间:2023-11-03 22:43:58 25 4
gpt4 key购买 nike

我想以用户可以看到但不影响文档内容的方式标记由我的加载项处理的文档。在 Word 中,如果转到"file"菜单,您会发现可以向 Word 文件添加标签。如果启用“标签”列,这些标签可以显示在 Windows 资源管理器中。也可以从资源管理器中设置标签。

我一直无法找到如何以编程方式访问这些标签。谁能给我一个提示?

最佳答案

您正在寻找 Document.BuiltInDocumentProperties

例如:

var properties = (Microsoft.Office.Core.DocumentProperties)
Globals.ThisAddIn.Application.ActiveDocument.BuiltInDocumentProperties;

properties["Keywords"].Value = "Processed by my add-in";

查看更多:How to: Read from and write to document properties

关于c# - Word VSTO - 向 Word 文件添加标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50875901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com