-
I'm sure this isn't the best way, could you do something like?:
(assuming you know the path of the word doc already)
[vba]Sub OpenFile()
Dim sFile As String
Dim IsFileLocked As Boolean
sFile = "C:\Test.doc"IsFileLocked = False
On Error Resume Next
Do Until IsFileLocked = False
' \\ Open file, if error occurs the document is open
Open sFile For Binary Access Read Write Lock Read Write As #1
Close #1
If Err.Number <> 0 Then IsFileLocked = True
Err.Clear
End If
Loop
Application.WindowState = xlMaximized
End Sub[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules