C# 4.0 Document.BuiltInDocumentProperties会使文档变脏,每次都会提示保存

C# 4.0 Document.BuiltInDocumentProperties会使文档变脏,每次都会提示保存,c#-4.0,ms-word,vsto,word-automation,C# 4.0,Ms Word,Vsto,Word Automation,使文档变脏,每次即使没有任何更改也会提示保存 我试图在文档更改事件中获取文档的模板 ActiveDocument.BuiltInDocumentProperties["Template"] 但效果很好 Template template = (Template)ActiveDocument.get_AttachedTemplate(); 此代码还获取文档的模板,并且不会使文档变脏。但是仍然很想知道为什么ActiveDocument.BuiltInDocumentProperties[Temp

使文档变脏,每次即使没有任何更改也会提示保存

我试图在文档更改事件中获取文档的模板

ActiveDocument.BuiltInDocumentProperties["Template"]
但效果很好

Template template = (Template)ActiveDocument.get_AttachedTemplate();

此代码还获取文档的模板,并且不会使文档变脏。但是仍然很想知道为什么ActiveDocument.BuiltInDocumentProperties[Template]会使文档变脏。

我不知道为什么会使文档变脏,可能是一个bug。你可以通过做下面的事情来解决这个问题

ActiveDocument.Saved=true