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

Free Support Forum - aspose.com

How to check protection type applied to document using .NET


I have a dotx template where Editing restrictions have been set to allow Filling in forms. However, protection hasn’t been enforced. Please see input.dotx inside Docs.zip.

I’m running the following code on it:
var doc = new Document(“d:/input.dotx”);

In output1.docx these options haven’t changed (restrictions set but not enforced).
It looks like ProtectionType on Document only holds the restrictions that have been enforced. So in this case it’s NoProtection. Protecting the document with this protection type removes the restrictions completely (please see output2.docx).

Based on output1, it looks like the information about restrictions is present somewhere in the document. Is there a way to access it? If not, would you be able to provide one?


Docs.zip (61.0 KB)


The document is not protected. You are facing the expected behavior of Aspose.Words. However, the Section.ProtectedForForms property is set for your input.dotx. You can get its value as shown below.

var doc = new Document(MyDir + "input.dotx");