Cannot Delete File After Closing It in Word for Windows

Last reviewed: July 30, 1997
Article 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: 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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.