home *** CD-ROM | disk | FTP | other *** search
- unit Main;
-
- { This program will not work unless Word is already
- running. OLEWORD2.DPR shows how to get around
- this limitation. }
-
- { NOTE: This program will only function correctly with
- the US version of Microsoft Word }
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ExtCtrls, StdCtrls, Buttons;
-
- type
- TOleWordForm = class(TForm)
- Image1: TImage;
- TalkToWord: TBitBtn;
- procedure TalkToWordClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- OleWordForm: TOleWordForm;
-
- implementation
-
- uses
- OleAuto;
-
- {$R *.DFM}
-
- procedure TOleWordForm.TalkToWordClick(Sender: TObject);
- var
- V: Variant;
- begin
- V := CreateOleObject('Word.Basic');
- V.Insert('Hello from Delphi');
- end;
-
- end.
-