RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
C++DelphiTech Partner

Create Word Docs Using the Direct Office Component In Delphi on Windows

Winsoft’s Direct Office is a nice third party solution which bypasses the middle-man – namely Word – to create, open, and save DOCX documents.

DOCX is a standardized file format. It can be read using Libre Office, SoftMaker’s TextMaker and on-line Google Docs.

Installation

Steps:

  1. Download the trial version
  2. Unzip doffice.zip
  3. Find Winsoft.DirectOffice.dll in .\doffice\Delphi\ along with the corresponding licenses in \doffice\Licenses\

DirectOffice vs Word COM API: Less code

Using Direct Office, you can reduce the amount of steps, bloat and coding to access Word Documents. Take for example, a simple operation of opening a document:

Direct OfficeMicrosoft Word COM API
Create DocumentCheck if Word is Open or Not.
If Word is not open, launch Word.
Check if Document is Open or Not.
If Document is not Open, Open it.
Check if View is in correct mode (Print View, Draft View…)
If not in correct view, change it accordingly.
Append PageInsert Page

Using the Word COM API, this is at least 35 lines of code. This includes exception checks, querying Word, if Word Document is already opened or not.

In DirectOffice, access to Word Documents is less than 4 lines of code on average.

DirectOffice vs Word COM API: Speed

What if I told you, you could create and save Word Documents between 110% to 500% faster than using Word itself?

The equivalent in DirectOffice:

The estimated time to run the above code in Word for a lenghtly document, is ~ 3 minutes. If you were doing data-processing on a large document, it could possibly take upwards between 30 minutes to days.

The estimated time to run the above code in Direct Office is in seconds.

If your customer does not have Microsoft Word installed, or using a competing Word Processor, such as Google Docs or Libre Office, your applications built using DirectOffice can still function. Prior installation of Office or Word is not necessary.

Winsoft sells the full-version at the website, which can open Word, Excel and PowerPoint documents. Your customer’s time is important. Which solution will you choose?

  • Works with: Delphi, C++Builder, VCL
  • Works on: Windows 32-bit, Windows 64-bit, Web

Head over and check out the full WINSOFT Direct Office library for Delphi and C++Builder

Like what you see? You can get Direct Office and over 100 other fantastic WinSoft components with our Enterprise Component Pack. For a limited time, when you purchase RAD Studio Enterprise or Architect Edition at special Upgrade Pricing, you will also get this package of third-party software worth over $13,000, including the full WinSoft Component Library, at NO EXTRA COST! Step up to RAD Studio 10.4 today!


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Learn More About Upgrading

About author

Technical Director at Polywick Studio. I have over 10+ years of experience using Delphi. I am a member of the Add-in-Express ADX Team, I developed ZPAY Payroll System, made using Delphi.
Related posts
C++CodeDelphi

Easy Steps To Connect To A MS Access Database With FireDAC In This Windows Sample App

C++DelphiTech Partner

Flexible Brotli Compression Library For Your Windows Delphi/C++ Builder VCL And FMX Apps

DelphiRAD StudioTech Partner

Quickly Work With A COMPort On Linux With Delphi Using A WINSOFT library

C++CodeDelphi

Learn To Build A Python GUI For Solving Complex Tasks With Powerful OpenCV Library In A Delphi Windows App

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Worth reading...
RAD Studio 10.4 Patches

IN THE ARTICLES