Security for Word Document

Hi,

I don’t find the answer to my question, may somebody can help me.
I try to Generate a document and set the security of it. I mean I want to generate a Word docuement which is write protected by a password or something like that.

It’s possible ???
Thanks for your help

Sorry, I found a new topic about that in the Forum.
But I don’t find how specify the PassWord.

I’m using:

doc.Protect(Aspose.Word.ProtectionType.ReadOnly);

Thanks

Hi,

Please read this topic and feel free to answer further questions if needed:

https://docs.aspose.com/words/net/protect-or-encrypt-a-document/

You cannot set a password explicitly via Aspose.Word because:

When you protect a document, and the document does not have a protection password, Aspose.Word assigns a random password that makes it impossible to unprotect the document in MS Word, but you still can unprotect the document in Aspose.Word as it does not require a password when unprotecting.

When you protect a document, and the document already has a protection password, the existing protection password is not changed.