Click here to Skip to main content
16,017,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If you create a standard MFC app in Visual Studio with OLE support and use the "Insert Object" feature to insert an RTF file using Word, Word exclusively locks the file and refuses to give it up for any reason - even closing the test app!

I'm seeing the same behaviour trying to do this in code with a COleClientItem derived class. This is very inconvenient because I'm generating the RTF file, and the only way to make it work is to use a new random temporary name every time I want to refresh the object.

Does anyone know why Word behaves like this or how to stop it? (in code I mean, I'm trying to do this with no user interaction. Note, I don't mind Word hanging around as the server app, but want it to release my files...).

(Also note...I had this problem before Shutting Down OLE Server[^] and still haven't managed to fix it!)

What I have tried:

COleClientItem::Close is supposed to do it, but doesn't.
Posted
Updated 22-Sep-24 15:38pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900