locked
Cant solve it!! DSOFile.dll error: The name is not valid. 0x800300FC (STG_E_INVALIDNAME) RRS feed

  • Question

  • User-431313886 posted

    Hello. I am using the DSOFile.OleDocumentPropertiesClass to read the author property of all files in a directory. It works perfectly on my machine, and another development server, but when I try it on our SQA server, I get this error:

    Exception:The name is not valid. (Exception from HRESULT: 0x800300FC (STG_E_INVALIDNAME)) File:\\eng-dev1\xxx_WebSite2\Projects\xxx2.0xxx\xxxatingWorksheet.xls

    I have been trying to solve this issue for a couple days now and I get the error every time.

    Is there somthing special I need to do to the path before giving it to the Open method in the OleDocumentPropertiesClass? Does it need to be unicode? I know the error code is actually "The name %s is not valid" so that %s is being replaced by an empty string maybe... really need help with this one. This is the code I have. Basically the Open call throws an error.

    DSOFile.OleDocumentPropertiesClass oleProps = new DSOFile.OleDocumentPropertiesClass();

    DSOFile.SummaryProperties summary;

    oleProps.Open(fi.FullName, true, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);

    summary = oleProps.SummaryProperties;

    last_saved = (DateTime)summary.DateLastSaved;

    Thanks for your time.

     - Andrei Bazhgin [cool]

    Thursday, October 25, 2007 3:57 PM

All replies

  • User-431313886 posted
    Can someone please help me with this. Its really important for me and my boss. There might be a monitery incentive...
    Monday, October 29, 2007 8:19 AM
  • User1609978478 posted

    you need to put a @ before the filename

      docDSO.Open(@"C:\test.doc", false, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);

    Wednesday, December 10, 2008 11:57 AM