|
|
MS Word - Проверка открыт ли документ по полному пути
Private Sub IfWordFileIsOpen_Close(app As Object, sPath$)
Dim objDoc As Object
On Error GoTo IfWordFileIsOpen_Close_Err
For Each objDoc In app.Documents
If objDoc.FullName = sPath Then
objDoc.Close
End If
Next objDoc
IfWordFileIsOpen_Close_Bye:
Exit Sub
IfWordFileIsOpen_Close_Err:
Err.Clear
Resume IfWordFileIsOpen_Close_Bye
End Sub
|
|