|
|
|
Delphi - Microsoft Word COM (1)
Users of Visual Studio.NET will know the importance of cross application support between your business application and Microsoft's office products. Providing your end users with Excel exports or Word reporting can change your software from neat to professional in a matter of minutes.
The technology to interface with Microsoft's office products is nothing new and has existed for 10 years or more. In today's times it has become easier to work with the office products but that does not stop us improving our existing legacy applications.
Using office products with Delphi (5) is achieved through the COM interface. Component Object Model provides a class interface that we can use in much the same way that we use our Delphi.pas classes. By using COM class objects and ActiveX we can work with these office applications at will.
In this article we will concentrate on the Microsoft Word application and how we can use its features together with our Delphi (5) application. Before we look at the features available lets start by looking at how we create a COM call to start MS Word and communicate with the Word application.
In order to use the COM classes and create a Word reference we must include the following classes in our units uses clause:
uses ComObj, ActiveX, Word2000, OleServer |
These classes are all included with the installation of Delphi (5). However if you wish to use a later version of Word such as Word2003.pas you will need to obtain this file before developing your application. All Office applications pas files are located under the Borland folder.

|
|
Featured |
Other popular Delphi resources. Why not try them for yourself?
|
|
Delphi Knowledge Base. Best practices, walkthroughs, tutorials, component advice and more. Solutions and professional designs for Delphi 4, Delphi 5, Delphi 6 and Delphi, 7. Word COM, Excel COM, Outlook COM including code examples for Word OLE, Excel OLE and Outlook OLE. Automating Outlook to create MailItem and send attachments in Delphi. ActiveX, Com. ADO Data Architecture, TMS component pack walk through and code examples. Using Developer Express and example walkthroughs. Date & time conversion routines, video playback and frame manipulation. COM articles, papers, tips, techniques and hints. How to create Word reports and excel spreadsheets using Delphi code and OLE automation. Understanding Delphi encryption and using ciphers, with source code examples of Blowfish, Twofish, and Rijndael. Securing application data and confidential information using open source encryption components. Free encryption dll component. Accessing and managing MS Excel sheets with Delphi. How to retrieve, display and edit Microsoft Excel spreadsheets with Delphi automation. Accessing and managing MS Word documents with Delphi. How to retrieve, display and edit Microsoft Word documents using Delphi automation. Read and write Excel spreadsheets using Delphi code. How to read and write registry entries using Delphi code. Source code examples using Delphi 5, Delphi 6 and Delphi 7. Working with VCL Developer Express components. How to apply grid styles and themes to Delphi applications. Using image columns and shading to improve the grid and treeview appearances. Including examples from ExpressQuantumPack, for Delphi, ExpressPack for Delphi. Developer guides for Developer Express components. All our articles are written by our senior Delphi professionals to help you get the best from your legacy Delphi applications |
|