|
-
Aug 2nd, 2001, 05:03 AM
#1
Thread Starter
Hyperactive Member
Locked FIles
I'm using the Word object's Open method to open a file, eg
Code:
Dim objWordApp as Word.Application
Dim objWordDoc as Word.Document
Set objWordApp = New Word.Application
Set objWordDoc = objWordApp.Documents.Open <Path>
This works fine, unless the file is opened by another user (or anothe rprocess) in which case the program hangs while waiting for a response to a message that the user can't see.
Is there any way to check if the file is locked before opening it. Being able to find out the name of the workstation that has it locked would be even better.
-
Aug 2nd, 2001, 05:10 AM
#2
-= B u g S l a y e r =-
maybe if u set the Visible parameter to true, it will show the msgbox...
VB Code:
Set objWordDoc = objWordApp.Documents.Open <Path>, , , , , , , , , , , True
-
Aug 2nd, 2001, 05:15 AM
#3
If you open it for read only it dont matter if another use has it open.
-
Aug 2nd, 2001, 05:42 AM
#4
Thread Starter
Hyperactive Member
I was probably a bit brief in the description of my problem...
The word application is opened in the background. Values are inserted into fields in the document and the document is saved with a unique name. All this happens when the user selects an option on a form, and should be invisible.
I've tried making a copy of the document, with the unique name and opening that, b ut that causes a whole load of other problems that i'd rather not go into.
-
Aug 2nd, 2001, 06:00 AM
#5
-= B u g S l a y e r =-
what if u turn off the word alerts? like this :
VB Code:
Dim objWordApp as Word.Application
Dim objWordDoc as Word.Document
Set objWordApp = New Word.Application
objWordApp.DisplayAlerts = wdAlertsNone
Set objWordDoc = objWordApp.Documents.Open <Path>
would that do any good ?
-
Aug 2nd, 2001, 06:58 AM
#6
Thread Starter
Hyperactive Member
-
Aug 2nd, 2001, 07:03 AM
#7
-= B u g S l a y e r =-
your welcome Jimbob
-
Aug 2nd, 2001, 08:35 AM
#8
Frenzied Member
Or create the document as a template, then it will open a new copy every time.
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
|
Click Here to Expand Forum to Full Width
|