none
Pb with readonly downloaded Word files in Content.MSO directory RRS feed

  • Question

  • LO,

    After installing IE8, we are facing a pb with Word documents downloaded from a central document server.
    We have développed a VBA macro wich need to make a ActiveDocument.Save before using LoadFromFile function on an ADODB.Stream object.
    That macro has been working for three years, but last week after an IE8 installation, and maybe some security policy applied by our customer, that macro is not able to Save locally Word documents downloaded in Content.MSO folder.
    Downloaded Word documents appear now as Read-Only files in IE cache, and even a System administrator is not able to save modifications in content.MSO folder. We have make it run again using a SaveAs Command in another directory, but it hurts our customer security rules.

    Could you give me a hand to solve that problem

    Thanks

    Monday, November 21, 2011 2:57 PM

All replies

  • Hi Franck,

    Thanks for your post.

    Would you like to tell us your customer's Word version? Does the issue happen on all the machines which install IE8 recently?

    It will ge great helpful If you can provide some code snippet about your macro.

    In additon, your customer might need have a try of IE9.

    Good day,


    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, November 23, 2011 11:58 AM
    Moderator
  • Hi, I'm back... (Thanks for your first reply)

    We have found a turnaround, saving the file in another directory, but that's not really safe for us and we are not able to use that method on all sites.

    The problem is spreading with IE8 migration on each site.

    The problem occurs on a WORD2003-IE8 configuration and the problem raise on IE8 installation. With IE8, files downloaded from a central server, seems to be read-only. Problem is linked to IE8, because sites wich are still using IE7 continue to work normally.

    Here is a snippet of our macro. The aim is:
    - to save current document edited in a Word embedded object in IE, in current directory (in our case, it's the content.mso directory)
    - to copy the file into a temporary file to be able to open it in an ADODB.Stream object
    - to load the file
    - to kill the temporary file

     Set fso = CreateObject("Scripting.FileSystemObject")
    
      'Retrieve temporary directory path
      value = GetTempPath(128, tempPath)
      currentDocTempPath = Left(tempPath, value)
    
        currentDocPath = ActiveDocument.Path & "\" & ActiveDocument.Name
        currentDocTempPath = currentDocTempPath & ActiveDocument.Name
        ActiveDocument.Save
    
    
      WordBasic.CopyFileA currentDocPath, currentDocTempPath
    
      Set stream = CreateObject("ADODB.Stream")
      stream.Type = 1 'Binary
      stream.Open
      stream.LoadFromFile currentDocTempPath
      getFile = stream.Read
      stream.Close
      
      Kill currentDocTempPath
    

    Our customer can not migrate to an IE9 configuration because he is still using Windows XP.

    Thanks for your help.

    Tuesday, December 13, 2011 10:56 AM
  • Hi, I'm back again.

    So the problem was linked to IE8, and occured because that Word documents template library was now opening in a Microsoft Word instance rather than in an Embeded Word object inside IE. Because of that, Microsoft Word was not able to Save the file in MSO cache directory.

    It's possible to restore that behaviour, going to Start/My Documents, then Tools/Options. Go to the third panel File types and search for Word documents extension. Click on advanced and Check Browse in same window.

    Here is the link which describe the opposite behaviour.

    http://support.microsoft.com/kb/178222/en-us?fr=1

     

    Thursday, January 5, 2012 3:49 PM