Hi,
Thanks for your inquiry.
There is a simple demo for you
- Code: Select all
Document doc = new Document();
doc.AddSection().AddParagraph().AppendText("Security Test");
doc.Protect(ProtectionType.AllowOnlyReading, "write");
doc.Encrypt("read");
doc.SaveToFile("out.docx", FileFormat.Docx);
System.Diagnostics.Process.Start("out.docx");
After run this demo, the word document file out.docx was opened via MS-Word (Word 2010 in my computer). I got the prompt as p1.png.
After entering the password "read", the file was opened. When I tried to edit it, I got the prompt in the right part of the MS-Word window, as p2.png
I cliked the button "Stop Protection" and then I got a prompt as p3.png
After entering the password "write", I could edit the document.
I attached also the out.docx file, you can try it with your MS-Word tool.
I ran the demo with Spire.Doc Pack Version:5.0 (version fo dll 5.0.12.30xx), you can get it from
http://www.e-iceblue.com/Download/downl ... t-now.htmlIf you still have this problem, would you please provide us the below detailed information, which may help us to reproduce your issue and offer the solution to you quickly.
1. Dll file list (name + version), for example:
Spire.Doc.dll v4.9.32.3040
Spire.License.dll v4.9.32.3040
Spire.Pdf.dll v2.8.86.3040
2. Operation System, for example:
Windows 7 Enterprise Edition SP1 x64
Regional and Language Options
3. Project can reproduce the issue
All code about this problem, a simple project which can reproduce this problem will be better.
4. Test Document or Test data
Please provide your test document to us if convenient, it may help us reproduce your issue quickly. We promise to keep your document confidential and we will not use it for any other purpose. Besides, you could also remove the security data of your document and then send it to us.
Thanks and Regards,
Login to view the files attached to this post.