I'm trying to see if your software can help me open up DOC/DOCX files. Some files are passworded, and I do not know which files they are, so I need to handle them.
This is my code:
- Code: Select all
Dim doc As Document
Try
doc = New Document(fileName)
'if this works, do something...
Catch ex As Exception
If ex.Message = "Document is encrypted, Open the password needs password." Then
'the file is password protected
'do something else...
End If
Finally
doc = Nothing
End Try
The problem is, no matter what I try, the file remains *locked* (on the filesystem). I cannot release the lock to the file, so the file cannot be renamed or deleted until I terminate the application. Any thoughts? I'm using your latest version, free for now. Thank you.