Make word document uneditable using C#
This is continuation to my last post on dynamically adding rows to table in word document. The post can be found here, https://jgvimalan.wordpress.com/2011/02/08/add-rows-to-table-in-ms-word-document-using-c/
I got a task where, the dynamically generated word document has to be made uneditable. Inorder to achieve that, you need to protect the document by allow only reading. The sample code snippet is given below,
var wordApp = new ApplicationClass();
wordApp.Protect(Microsoft.Office.Interop.Word.WdProtectionType.wdAllowOnlyReading, ref missing, ref missing, ref missing, ref missing);
This will make the word document uneditable.
No comments yet.