Free Support Forum - aspose.com

Aspose Compare Report and Disable Word Table Cells

Hi All,


I have a word document upload programs which keeps multiple version of the same file in the database. The extract of this documents are done using aspose words. I have two new requirements,

1. TO block edit on particular cells of the word document and enable track changes. I am little worried in Aspose provides the facility to protect the document parts/word tabel columns. Could you please help me if you have any samples. I have attached a sample word file, I need to disable the cells colored in green.

2. Generate a compare report(similar to WORD Compare) compare between two versions of the same file.

Thanks.

Regards,
Aju P Sebastian
Hi there,

Thanks for your inquiry.

ajupulickal:

1. TO block edit on particular cells of the word document and enable track changes. I am little worried in Aspose provides the facility to protect the document parts/word tabel columns. Could you please help me if you have any samples. I have attached a sample word file, I need to disable the cells colored in green.


Apose.Words support to protect selected ranges. But please note that currently editable ranges are supported only at the inline-level, that is inside Paragraph, but editable range start and editable range end can be in different paragraphs. Badly formed editable range will be ignored when the document is saved. For your requirement, you can insert start and end range accordingly.

Furthermore, to protect a range in Word document EditableRangeStart class represents a start of an editable range in a Word document. EditableRangeEnd class represents an end of an editable range in a Word document. A complete editable range in a Word document consists of a EditableRangeStart and a matching EditableRangeEnd with the same Id. EditableRangeStart and EditableRangeEnd are just markers inside a document that specify where the editable range starts and ends.

Please check following code example to protect header and footer of first section of the document. Hopefully it will help you to accomplish the task.

Document doc = new Document("in.docx");

doc.Protect(ProtectionType.ReadOnly);

DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveToParagraph(0, 0);

builder.StartEditableRange();

builder.MoveToParagraph(doc.FirstSection.Body.Paragraphs.Count - 1, -1);

builder.EndEditableRange();

doc.Save(“Out.docx”);


ajupulickal:
2. Generate a compare report(similar to WORD Compare) compare between two versions of the same file.

Aspose.Words for .NET support to compare Word documents. Please check following documentation link for details. Hopefully it will help you to accomplish the task. However, if there is some difference in your requirements and my understanding then please share some more details, so we will guide you accordingly.


Best Regards,