Use this VBA code to password protect or unprotect the Word document while openening the file. This macro also handles readonly protection, Write protection etc., right within the code itself.
Password Protect Excel 2010 & 2007
Easy method to Password Protect Excel 2010, 2007 and also Word documents in just few clicks with built in option. Also Learn different possible methods to Protect Office Documents using Inbuilt Options and VBA. Applicable To: MS Excel, Word or PowerPoint of MS Office 2007 and above.