I have a document with content controls that tracks changes on the document. When loading the document, HasChanges property doesn't return true if the changes are on content control.
Below is the code snippet.
- Code: Select all
static void Main(string[] args)
{
string filePath = @"C:\Users\User\Documents\";
Document documentWithContentControl = new Document();
documentWithContentControl.LoadFromFile(@"{filePath}documentWithContentControl.docx");
Console.WriteLine($"documentWithContentControl has changes using property - {documentWithContentControl.HasChanges}");
Document documentWithoutContentControl = new Document();
documentWithoutContentControl.LoadFromFile($"{filePath}documentWithoutContentControl.docx");
Console.WriteLine($"documentWithoutContentControl has changes using property - {documentWithoutContentControl.HasChanges}");
Document documentMixWithChangesInCC = new Document();
documentMixWithChangesInCC.LoadFromFile($"{filePath}documentMixWithChangesInCC.docx");
Console.WriteLine($"documentMixWithChangesInCC has changes using property - {documentMixWithChangesInCC.HasChanges}");
Document documentMixWithChangesNotInCC = new Document();
documentMixWithChangesNotInCC.LoadFromFile($"{filePath}documentMixWithChangesNotInCC.docx");
Console.WriteLine($"documentMixWithChangesNotInCC has changes using property - {documentMixWithChangesNotInCC.HasChanges}");
}
Attaching the 4 documents that I used to test this.
Can you please check. Checking for tracked changes on the word document within content control is an important scenario for us, I would appreciate if you can help with it.
Thank You!
Jalpa