home *** CD-ROM | disk | FTP | other *** search
- { NOTE: This program will only function correctly when the US version of
- Microsoft Word is installed. }
-
- unit Main;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls;
-
- type
- TOleWordForm = class(TForm)
- TalkToWord: TButton;
- Image1: TImage;
- procedure TalkToWordClick(Sender: TObject);
- private
- V: Variant;
- public
- { Public declarations }
- end;
-
- var
- OleWordForm: TOleWordForm;
-
- implementation
-
- {$R *.DFM}
-
- uses
- OleAuto, Ole2;
-
- procedure TOleWordForm.TalkToWordClick(Sender: TObject);
- begin
- V := CreateOleObject('Word.Basic');
- V.FileNew('Normal');
- V.Insert('The mark of a healthy mind' + #13#10);
- V.Insert('is freedom from its own ideas.');
- V.FileSaveAs('C:\SEMPERFI.DOC',,,'Sammy');
- end;
-
- end.
-