We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Formatting Track Change

This post is to query how to identify the “formatting Track Change” for Microsoft Word Documents for example when the user change some text to Bold, underline, strikethrough, etc.





We actually identified the Track Change with these properties (Inline.IsDeleteRevision, Inline.IsInsertRevision) and we edited the following properties by code:





DeleteRevision:

inline.Font.Color = Color.Red;

inline.Font.StrikeThrough = true;





InsertRevision:

inline.Font.Color = Color.Blue;

inline.Font.Underline = Underline.Dotted







After we edit these properties in the word document, we transform this to Xps to view the track change, but in this point we cannot identify the “formatting Track Change” by code and we cannot show these track change in the xps.







How can we identify the “Formatting Track Change” and show the same in an xps document in the version 13.2 Aspose.Words.dll?



Kind regards,

Hi Gerardo,

Thanks for your inquiry.

We have introduced a new "RevisionOptions" class in Aspose.Words. It allows to control how document revisions are handled during layout process. You do not create instances of this class directly. Use the RevisionOptions.LayoutOptions property to access layout options for this document. Note that after changing any of the options present in this class, UpdatePageLayout method should be called in order for the changed options to be applied to the layout. Please see the following code for an example:

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

RevisionOptions ro = doc.LayoutOptions.RevisionOptions;

ro.InsertedTextColor = RevisionColor.ByAuthor; // For inserted revisions each author gets own color

ro.DeletedTextColor = RevisionColor.NoHighlight; // Deleted revisions are not highlighted

ro.RevisedPropertiesColor = RevisionColor.DarkBlue; // Formatting revisions will be marked in dark blue

ro.RevisionBarsColor = RevisionColor.DarkYellow; // Revision Bars on the side of the page will be dark yellow

doc.Save("output.xps");

I hope this helps.

Best regards,