Board index » delphi » How to create a word document using Delphi5?

How to create a word document using Delphi5?

Hello,

I hope this is the correct group for this question. If not coul dplease
let me know where should I post it?

I wrote an application which generates a great amount of web pages. Now
I want to be able to insert each one of these pages into a word document
with a page break in between. Can somebody tell me if this is possible
and perhaps send me some sample code?

Thanks in advance,

Nick

 

Re:How to create a word document using Delphi5?


Quote
Nick Tentomas wrote:
>I wrote an application which generates a great amount of web pages. Now
>I want to be able to insert each one of these pages into a word document
>with a page break in between. Can somebody tell me if this is possible
>and perhaps send me some sample code?

/=============== [ Word & Excel Tips ] ================
|  Deborah Pate's Automation Pages
|   http://www.djpate.freeserve.co.uk/Automation.htm
|  Graham Marshall: Word & Excel with Delphi
|   http://vzone.{*word*269}.net/graham.marshall/word.htm
|   http://vzone.{*word*269}.net/graham.marshall/excel.htm
\======================================================

Cheers,
   Udo
--
Homepage: http://www.nesshoever.de                Env.: W2K.sp1, D4Pro.sp3
           ===>>   Polio-Tour: http://www.2-mad.com/   <<===

        Reply into newsgroup. Unrequested mails will be ignored.

Re:How to create a word document using Delphi5?


Hallo Nick,
you must be a client of the Winword COM-Server.
Open the file named Winword9.olb with Delphi 5 to see the full
description of the COM- Interface from Winword.
Further look into the Objectcatalog from the Visual
Basic- Editor of Winword to get more information.

Please follow these steps:

1. Define a variable of Type Variant
2. Connect Winword local with the function
   Variant := CreateOleObject('Word.Application')
    At now you must see the process winword.exe in your
    Taskmanager.
3. Create an new document with the add-method of
   the Application-Object of Winword:
  Variant.Documents.Add;
4. At last terminate the winword task (your COM-Server)
    with the Quit-Method or send Winword a WM_KILL-
    Message.

Now you are be able to connect Excel, Outlook and all other
COM-Server you can get. It is always the same way.

For more details look into the VB-Help, because the BORLAND-documentation
from Microsoft Interfaces is very thin.

Jasper

Other Threads