OLE Automation with Delphi part I
Today I'm going to publish about a little application I've been developing recently for one of my clients. This little application pretends to use the Microsoft word OLE Automation to build a document with incrustation of images in it. But Why have I used OLE automation instead of working with the TLB functionality?. That's simple, because working with the OLE can help me with any of the Microsoft documents, and I recommend to work with the TLB when you are sure that you'll be working with a concrete package of Microsoft Office. For example, with the Office 2007, you can use the version 12.0 of the Object Library for your own purpose (but having in mind that you have to follow the license rules) . The major problem working with OLE is that's difficult to know how exactly do the things that you want. In my case I wanted to insert some stretched pictures inside a word document in a correct position. After seeking out all the information, I've managed to build this little application that will help you to encrust images inside the document. If we load all the images and try to generate the document, the selected images will be encrusted like the next image: Notice that It works with word 2003 or 2007 (but I've found some problems with the 2007). Anyway, the little code for encrust an image to a word document would be like this:
You can find this little application here: Related Articles: |
|