I see that this issue was already raised at least 11 years ago:
https://social.msdn.microsoft.com/Forums/en-US/ab69e025-8aac-4349-8aef-703c4608b3eb/cant-delete-file-after-renaming-due-to-word-file-handle-still-present-error-staes-document-is?forum=isvvba
My own situation is slightly different, but it's the same underlying issue.
I open a Word.Document in a .NET application. The Word.Document happens to be referencing an old style ".doc" rather than a ".docx"
Once it's opened, I use .SaveAs2 to save a copy of this document to a new location.
At that point I need to copy another file to the original location.
This fails because even after the .SaveAs2 which saved the document to a new location, Word still holds a lock on the original .doc
The problem doesn't arise with .docx documents. Nor does it arise with .xls workbooks (using the equivalent Excel objects). Only in Word.
And no, I can't code around it. The .doc is opened by one application, while our Add-in is trying to then use SaveAs2 to copy it to another location. At this point the document is already open and I cannot close it because the calling application holds a handle to the Word.Document.
Yes, I can code around it by modifying the original application. Simply let it convert the .doc to a .docx and then present it to the user. But that requires a new version of the original application. Our users are fickle beasts. Some of them want to be able to use the OLD application with the NEW addin. And the only thing preventing us from giving them that option is this issue.
Like I said. This was already reported to Microsoft at least 11 years ago. Who knows how long people have faced similar issues before that.