Jump to content

Search the Community

Showing results for tags 'directoffice'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. I'm trying to test out this DirectOffice library but their demo project is really very limited. I need a little help. Their library file is quite big which can be found here Demo. But let me just point out some since I'm a bit confuse with the IComparable in assigning the value to the property. I'm trying to compare some C# code and convert the same code in Delphi. Consider this code (C#): MainDocumentPart mainDocumentPart = doc.AddMainDocumentPart(); mainDocumentPart.Document = new Document(); Body body = mainDocumentPart.Document.AppendChild(new Body()); Paragraph para = body.AppendChild(new Paragraph()); Run run =para.AppendChild(new Run()); RunProperties runProperties = run.AppendChild(new RunProperties()); FontSize fontSize = new FontSize(); fontSize.Val = "40"; runProperties.AppendChild(fontSize); run.AppendChild(new Text("Welcome!!!!!")); mainDocumentPart.Document.Save(); Using the DirectOffice library, it would look like this in Delphi: MainPart := WordDocument.AddMainDocumentPart; // create document Document := CoDocument.Create; MainPart.Document := Document; // create body Body := CoBody.Create; Document.AppendChild(Body as _OpenXmlElement); // create paragraph Paragraph := CoDocumentFormat_OpenXml_Wordprocessing_Paragraph.Create; Body.AppendChild(Paragraph as _OpenXmlElement); // create run Run := CoDocumentFormat_OpenXml_Wordprocessing_Run.Create; Paragraph.AppendChild(Run as _OpenXmlElement); Runproperties := CoDocumentFormat_OpenXml_Wordprocessing_RunProperties.Create; Fontsize := CoDocumentFormat_OpenXml_Wordprocessing_FontSize.Create; Fontsize.Val := '40'; //this error, Incompatible types: IComparable and string The last line is obviously a string, I'm not sure how I can convert it to iComparable type. Base on the DirectOffice.pas library, the following are the declarations. Can someone guide me perhaps in what I can look into next? _DocumentFormat_OpenXml_Wordprocessing_FontSize = interface(IDispatch) _DocumentFormat_OpenXml_Wordprocessing_FontSizeDisp = dispinterface property Val: IComparable read Get_Val write _Set_Val; Any response is appreciated. Thanks much!
×