When a word file is used by another user, I want to open it readOnly, but how can I hide the dialog of "File is using!" by the default mode of "ReadOnly"?
The following is the source code:
wordApp.displayAlerts = wdAlertsNone
Set WorkDoc = WordApp.Documents.Open(fileName, ConfirmConversions _
:=False, ReadOnly:=True, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, Visible:=WordAppVisible)
wordApp.displayAlerts = wdAlertsAll
The following is the source code:
wordApp.displayAlerts = wdAlertsNone
Set WorkDoc = WordApp.Documents.Open(fileName, ConfirmConversions _
:=False, ReadOnly:=True, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, Visible:=WordAppVisible)
wordApp.displayAlerts = wdAlertsAll