Cannot Delete File After Closing It in Word for Windows

ID: Q69946


The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c


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:

  1. After you close the original document.


  2. Open a second document and Copy some text from the document to the Windows Clipboard. This releases the Windows file handle.


  3. Close the second document.


  4. You should now be able to delete the original document.


Method 2:

Exit and restart Word for Windows.

Additional query words: winword 1.x 2.0 winword2 word6 6.0 win31

Keywords :
Version : WINDOWS:1.0,1.1,1.1a,2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c
Platform : WINDOWS
Issue type :


Last Reviewed: September 28, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.