September 21st, 2005, 03:42 PM
Opening a password protected word file
I'm writing an app to open a password protected word document. Fear not, the worriers among you - it is my own document with a password I do not recall. However, to be honest, I would use it elsewhere if the need arose...!
Right, the problem is not opening the file, this I can do, it is the time it takes to attempt to open it before the error is returned due to an incorrect password. It takes almost one second. If going through a password of 6 characters in length including chars 0 to 9, A to Z and a to z this is clearly going to take some time. Forget about a 7 character password - my cpu would melt! Though, to be honest, I'm very sure the password 5 chars long, which should take about one day max to crack (if 'zzzzz', but it isn't that, so less than a day in reality). And yes, I have a poor spec PC.
I'm using the following to open the doc (referencing word 9 object library):
So, is there a quicker way of opening a word file?
Set mobjWord = New Word.Application
Set mobjDoc = mobjWord.Documents.Open(txtFileName.Text, , , , Password, , , Password)
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.