Here is how you can crack the password protected word document: Suppose you have word file named as mydocument.doc. Firstly, open the document and click the Save As option to save it as an RTF (Rich Text Format) file. The file will end up being named as mydocument.rtf. Open the RTF file you have just saved by double-clicking it.
Active8 months ago
I have a word document that prompts the user for a password to open it, the dialogue box is like below.
I found some code to break a password using brute force which is below (written it from with Excel). The only issue is when I use Documents.Open if the password is wrong word shows the dialogue box - is there anyway to get round this?
Matt11.4k2222 gold badges7272 silver badges102102 bronze badges
mHelpMemHelpMe2,3111515 gold badges4545 silver badges8888 bronze badges
4 Answers
The file needs to be in
.docx
format, if it is .doc
convert it to .docx
:- Create a back-up copy of the file.
- Change the extension from
.docx
to.zip
. - Open new
.zip
file and extract all files. - In the extracted folder go to to
wordsettings.xml
. - Open
settings.xml
and remove the code from<w:documentProtection
to/>
and save the file. - Copy the new
settings.xml
to the original.zip
file and overwrite the old one. - Rename the
.zip
to.docx
and open file which is now protection free!
11.4k2222 gold badges7272 silver badges102102 bronze badges
Use
ChipsLettenChipsLettenSendKeys '{ESC}'
immediately before you try to open the file.2,71611 gold badge77 silver badges2626 bronze badges
As 'Matt' said simply converting the file extension to .zip and then editing the .xml file using notepad or notepad++, removing the entire line after w:documentprotection all the way to /> and then resaving the new .xml file inside the .zip folder will remove the password protection. Tried and tested in Word 2016. Just don't forget to rename the now edited zip folder back to .docx so its readable in Word. All credit to Matt.
LeonLeon
I adjusted your original code, so it's not dependent on the password being a certain length. Also it will now move from left to right, adding a new character with each pass, and prevents the popups when trying to open the document. This can be used for workbooks as well.
WARNING** The brute force method is really not even worth it. It takes a very long time to run. If it is an encrypted password, then this may be the best option without downloading a third party password breaker.
W-hitW-hit
protected by Community♦Feb 7 at 12:21
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?