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

Free Support Forum - aspose.com

How to both enable Track Revisions for Text and Protect watermark and image in document

Is it possible to do section by section document protection as it is with Word automation and enable TrackRevisions as well? I’m trying to protect a watermark image and a signature image in the document but enable Track Revisions in the remainder of the document.
Thanks!

Hi,

Thanks for your inquiry. I’m working over your query and update you soon.

Best Regards,

Hi,

Sorry for the delayed response. Please check following code for protecting selected sections of a document and to enable TrackRevisions property of document. Hopefully it will help you to get your desired results.

// Create a blank document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert two sections with some text
builder.Writeln("Unprotected section with some text.");
builder.InsertBreak(BreakType.SectionBreakContinuous);
builder.Writeln("Protected setion with some text.");
//Section protection only works when document protection is turned and only editing in form fields is allowed.
doc.Protect(ProtectionType.AllowOnlyFormFields);
// By default, all sections are protected, but we can selectively turn protection off.
doc.Sections[0].ProtectedForForms = false;
//TrackRevision property set to true to indicate the revision tracking in Microsoft Word will be enabled
doc.TrackRevisions = true; 
doc.Save(MyDir + "out.docx");

Please feel free to contact us for any further assistance.
Best Regards,

Thanks! That helps but one of the pieces I’m trying to protect is a watermark image that I’ve placed in a header. It appears that I’m able to keep it from being edited but the user can just remove the header. Is there a way to prevent the header from being removed also (I assumed using the protect method would do it but it appears to only apply to editing)?

Hi,
Thanks for your inquiry. Please check attached protected document with track revision enabled and watermark image. Protecting document also prevents content deletion in MS Word. Hopefully it will help. Please confirm are you able to delete watermark image using MS Word?
Please feel free to contact us for any further assistance.
Best Regards,

Thanks for the prompt response. Yes, I’m able to remove the header from the document that you attached also. All I needed to do was go to the Header menu item in Word then select ‘Remove Header’ and it deleted the header.

Hi,

Sorry for the inconvenience faced. Unfortunately, Aspose.Words does not support header footer protection in parallel with editable sections. However, I have created a new feature request in our issue tracking system, WORDSNET-6719. You will be notified via this forum thread once this feature gets available.
Please feel free to contact us for any further assistance.
Best Regards,

The issues you have found earlier (filed as WORDSNET-6719) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.