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]