Word forces open a file from Temporary Internet Files directory RRS feed

  • Question

  • We have a legacy C++ application that incorporates IE dlls and loads Word docs through a OLE/Active Document implementation. On a click from a user in the webpage, the application will download a Word doc to the files location ("C:\Users\username\AppData\Local\Temp\appname") and open it. We have run into an issue with some setups of Word 2013, where the file is opened, and then Word will close and then reopen with the file being re-opened from the Temporary Internet Files location instead. The file opens the first time on a call to OleCreateFromFile, and then it will immediately close (the HRESULT is S_OK). Later when we call OleRun for the IOleObject, it will open in the file from the temp internet files location. Later, when we go to save the document and re-upload it to our servers, we run into problems because the document is opened from the wrong location.

    As mentioned before this is a legacy application without any issues on previous versions of Word. With Word 2013 it seems to depend on how Office 365 is installed. If it installed from the website, it seems to be working correctly; if it is installed from the portal.microsoftonline website, the issue is apparent.

    Does anyone have any idea what is causing this, or how to avoid it?

    Wednesday, June 19, 2013 12:06 AM

All replies

  • Hi Mikekehoe,

    Thank you for posting in the MSDN Forum.

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best regards,

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 20, 2013 10:43 AM
  • I have dug into this some more and had a chance to look at the behaviors side by side in a debugger. First, this code is deprecated code known as DSOFramer. It seems that when a word document is opened via the OleCreateFromFile, it is standard to open it from the Temp Internet Files location. If there is a registry entry under CLSID for the guid of the document type for "DocObject", the DSOFramer code will open it with the OleCreateFromFile. The installer from the portal.microsoftonline site is not inserting the "DocObject" registry entry, hence the different behavior. 

    Friday, June 21, 2013 1:29 PM