Posts

Showing posts with the label Bullet

MS Word Automation in Delphi

Techniques to control MS-Word from a Delphi application are discussed in this blog. As a demonstration, I have added different codes which allows to use Word to create tables, to format strings, to create paragraphs and to insert different objects like images, shapes, word arts etc. Finding a PC that does not have MS-Word installed may prove a difficult task: The word processor from Microsoft is ubiquitous. It therefore makes sense to use it whenever it is necessary to create beautiful output from a program. Delphi makes it actually very easy: The language support for Variants as references to OLE automation servers and the support for COM interfaces make steering MS-Word (or indeed Excel or MS-Access) quite easy. Controlling MS-Word is done through its COM interface: Through Delphi’s OLE mechanism, an OLE reference is obtained to the MS-Word application, and then the various commands exposed by the MS-Word interface can be used to let MS-Word do virtually anything that is neede...