[RESOLVED] Detecting if Word has password to open
Hi,
Is it possible to detect if a word document has a password to open it at the time of opening the actual document?
I have a java application which is using jacob (java com bridge) to open word documents. If a document has a password to modify it is possible to open it in read-only mode, however, if a document has password to open how can this be detected. I want to just display a message to user and cancel the operation.
TIA,
Re: Detecting if Word has password to open
The only way to detect a password is to have the document open as read only first.
Re: Detecting if Word has password to open
Thanks RobDog888, the only thing is Word does not give a Open in Read-Only option when there is password to OPEN rather than MODIFY
Re: Detecting if Word has password to open
Yes it does. Pass True for the ReadOnly argument when opening the document.
VB Code:
Application.Documents.Open "FileName:="C:\MyDoc.doc", ReadOnly:=True