Cannot Delete File After Closing It in Word for Windows

ID: Q69946

The information in this article applies to:

SYMPTOMS

If you try to delete a Word for Windows document after you close the document in Word, sometimes one of the following error messages occurs, indicating that the file is open:

   If you delete the document from    The message reads
   -------------------------------    -----------------

   The MS-DOS command prompt          Access Denied.

   Windows File Manager               File Manager cannot delete
                                      <filename>: Access is denied.
                                      Make sure the disk is not full or
                                      write-protected.

   Word 6.0 for Windows Find File     Word cannot delete the file.
   dialog box                         <filename> is not accessible or is in
                                      use.

   Word 2.x for Windows Find File     Word cannot delete the file.
   dialog box                         <filename> is in use.


CAUSE

Before you closed the document in Word, you copied a selection in the document to the Windows Clipboard. By design, when you copy text to the Clipboard, Word places a pointer to the original document on the Clipboard instead of an actual copy of the selection. The pointer keeps open a Windows file handle to the document, even after you close the document in Word. As a result, if you try to delete the document, the system considers it to be open and aborts the delete operation. Similarly, if you reopen the file, Word considers the file to be open elsewhere, so the file opens as read-only.

This occurs more frequently in Word 2.x than Word 6.0 because Word 6.0 does the following, whenever possible, to minimize the number of times it has to maintain a pointer to the original file after you close a document:

1. If the selection does not contain multiple sections or a picture, or if

   it is not excessively large, Word copies the selection to the scratch
   (.TMP) file, located in your TEMP directory. Windows maintains a pointer
   to the .TMP file instead of the original Word document.

2. If the selection contains multiple sections or pictures, or if the file
   is located on a floppy disk, Word copies the entire file to the TEMP
   directory and changes the pointer to that copy.

3. If the file is larger than 256K, Word 6.0 maintains a pointer to the
   original document and the file handle remains open, as described above.

WORKAROUNDS

Method 1: a. After you close the original document.

          b. Open a second document and Copy some text from the document
             to the Windows Clipboard. This releases the Windows file
             handle
          c. Close the second document.
          d. You should now be able to delete the original document.

Method 2: Exit and restart Word for Windows.

KBCategory: kbother kbenv KBSubcategory: Additional query words: winword 1.x 2.0 2.0a 2.0a-CD winword2 word6 2.0b 2.0c 6.0 6.0a 6.0c win31

Version           : 1.x 2.x 6.0 6.0a 6.0c
Platform          : WINDOWS

Last Reviewed: July 30, 1997