Is there version of Dsofile.dll applied for C#?

Hi,

I haved defined a object of DSOFile.CustomProperty named cp,but I can't the cp.value with c#. The property of value is not supported by c#, so how can I get the property of value with c#.

Thanks for your help!



Answer this question

Is there version of Dsofile.dll applied for C#?

  • Abobrix

    Because I use the DSOFile.dll for my office project,so posted the question here.

    Thanks for the help!


  • Kathy0505

    DSOFile.OleDocumentPropertiesClass odpc = new OleDocumentPropertiesClass();
    odpc.Open(@"H:\test\project.xls",false,DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);
    foreach(DSOFile.CustomProperty cp in odpc.CustomProperties)
    {
    Console.WriteLine(cp.Name);
    Console.WriteLine(cp.Type);
    Console.WriteLine(cp.Value.ToString());
    }
    odpc.Close();

    The question is at "cp.Value.ToString()". This is the message:

    Property、Indexer or Event is not supported by this language.

    Anyone can help me Thanks


  • JosepMiquel


    That's how I looked up the interface, downloaded it from the page you referenced, added it to a tiny testproject and looked at the object browser.

    Good work!

    -= Maarten =-



  • Greymatter


    This forum is mainly for issues related to Visual Studio Tools for the Office System but I couldn't resist. This is what I found on the DSOFile.CustomProperty in relation to c#.

    object get_Value()
    Member of DSOFile.CustomProperty

    void set_Value(ref object pvValue)
    Member of DSOFile.CustomProperty

    -= Maarten =-



  • kocherek


    > cp.Value.ToString()

    change to cp.get_Value().ToString() ... see my previous posting

    -= Maarten =-



  • Jim Spath

    Hi

    I cant resist either :)

    The dsofile.dll source at the following location is a com wrapper for adding and supporting compound ole documents such as office and also supports on NTFS file systems an Alternative File Stream file that will support these properties on non OLE Documents such as a txt file which is quite cool.

    You could try and mimic this using all native code but as the dsofile.dll is distributable and easily referenced then will be best way to do this

    Regards

    http://support.microsoft.com/ id=224351 is the KB article on this



  • Is there version of Dsofile.dll applied for C#?