Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing File Handles to release locked file

Status
Not open for further replies.

asid

Programmer
Aug 19, 2002
13
0
0
AU
Hello everyone

I would like to be able to close a file handle on a locked file.

I have a situation where one program creates a Word document based on a template, and then passes the new document to Word for editing. However, the template is not released when the first program (HotDocs - document automation tool) is finished with it, and no-one else can access the file until Word is closed.

I am happy to use API calls to accomplish this.

Many thanks

Antony
 
There may be a solution such as the one you seek, but let's see if this process cannot be redesigned to accomplish the same thing.

When the automation tool is done, save file and close Word. Then, pass the file name to the next application. There is really no need to keep Word open is there? The next application, having the filename, can open it at will.

If the next "application" is a user, saving the file, closing Word, then launching a fresh copy of Word for them, should accomplish the same trick.
 
Hello Dimandja

Thanks for your suggestion.

Unfortunately, the resultant Word document must remain open for editing by the operator.

Regards

Antony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top