Is it possible to lock a document?


this totally goes against what you want a doc for but is it possible to lock a Aspose.Word doc so that the user cannot edit any of the data on the doc??

basically we want to prevent low level users being able to edit the doc. but high level users can edit the doc once its produced

i realise the Protect Method is there but is there not a full protection, as in no edit whatsoever



We can only do what MS Word can do in this respect. Use ProtectionType.AllowFormFields, this is close enough to full protection.


nice one. cheers


Is there any way to lock certain block of text in the document using aspose.



As Roman has mentioned, Aspose.Word capabilities do not exceed MS Word ones. So you can lock the whole document, not a certain block of text.


I think you can lock per section.

Try setting Document.ProtectionType = ProtectionType.AllowOnlyFormFields
and then setting each section Section.ProtectedForForms = true.

see this for more info