Student Corner |
Break Microsoft Word Password |
As we know, Microsoft Office is closed to VB and it's
scripts were wrote by VBA. Hence, we can find MS Word password by VB.
Private Sub cmdopendoc_Click() Dim wd As New Word.Application Dim strpath As String Dim pass As String Dim J, K, Pass_long As Integer Dim Max_num, Min_num, I As Long strpath = File1.Path & "\" & File1.FileName On Error Resume Next
Pass_long = Val(Text2.Text) Max_num = 10 ^ Val(Text2.Text) Min_num = 10 ^ (Val(Text2.Text) - 1) Flag = 0 For K = 0 To Pass_long - 1 Max_num = 10 ^ (Pass_long - K) Min_num = 10 ^ (Pass_long - (K + 1)) For J = 0 To Pass_long - 1 cmdopendoc.MousePointer = 11 For I = IIf(Pass_long - K = 1, 0, Min_num) + J To Max_num Step Pass_long Text1.Text = pass Text1.Refresh pass = String(K, "0") & I Flag = wd.Documents.Open(FileName:=strpath, passworddocument:=pass) If Flag <> 0 Then Label1.Refresh Text1.Text = pass wd.Visible = True cmdopendoc.MousePointer = 0 Exit Sub End If Next I Next J Next K MsgBox "Wrong Passwrod, re-enter" End Sub
End End Sub
File1.Path = Dir1.Path End Sub
Dir1.Path = Drive1.Drive End Sub
Call cmdopendoc_Click End Sub www.often.tk 2004 |