
If no password is found, then we can start searching for the lost password through the 20+ billion passwords database. This work is done very quickly (from a few seconds to a couple of minutes), and is successful in 22% of cases. We offer you a free MS Word password recovery try with a search through a database of 3 million of the most popular passwords. What are the Chances of Recovering a Lost Password? Here is another related topic from Microsoft forum about Word document password protection.If your file size exceeds the limit, please contact the Support Team for other options. > wdProtectionType & corresponding valueġ. With document.Protect function You can use one of these parameters which serves different purpose. Then make the macro to read files one by one and enable password protection. Instead, with this process, you can place all the word documents in a folder. It is tough to open and edit each document one by one and then enable a password. This VBA code is very useful, then you have multiple files to be marked as readonly or protected from users editing it. ObjDoc.Protect 3,, passwd '3- Refer end of the page for more parameters If ActiveDocument.ProtectionType -1 Then oDoc.Unprotect passwd Then, after processing the data, the code enables writeProtection on the document. Then in the next step, you will be able to edit or read contents

The below code unprotects a word document with password for readonly. VBA Code to Unprotect Word Document – Enable Editing In case your document is only writeprotected, then use the below method. This is a document level password protection. Once the document is opened using this method, its content can be edited or extracted. ODoc.SaveAs Filename:=sFileName, Password:=passwd Set oDoc = (sFileName, PasswordDocument:=passwd) Set oWord = CreateObject("Word.Application")


But how to deal with these password protected files with a VBA code. Well, manually you can type the password. It will only display the contents of the file, if the entered password is correct. Now, everytime the word document is opened, it will ask for a password. File -> Info -> Protect Document -> Encrypt with password.This option can be found in this menu navigation 1.VBA Macro to Open Word Document with Password ProtectionĪ word document can be saved with protection on & a password set for encryption. Lets see each of these categories and how to deal them when we automate the process through VBA. Document level Password with Encryption.Yes, there are more than one methods available to password protect a Word document.Īnd it confused the programmers all the time about, which code to use to unprotect the document & read the content.
