Document.BuiltInDocumentProperties makes the document dirty and prompts to save everytime

StackOverflow https://stackoverflow.com/questions/10384643

سؤال

The Document.BuiltInDocumentProperties makes the document dirty and prompts to save everytime even nothing has changed.

I am trying to get the template of the document in the document change event

ActiveDocument.BuiltInDocumentProperties["Template"]

But ActiveDocument.CustomDocumentProperties works fine.

هل كانت مفيدة؟

المحلول

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

This code also gets the template of the document and it doesn't makes the document dirty. But still curious to know why ActiveDocument.BuiltInDocumentProperties["Template"] makes document dirty.

نصائح أخرى

I do not know the logic in why this makes the document dirty, perhaps it is a bug. You can work around it thought just by doing the following.

ActiveDocument.Saved = true;

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top