unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, comobj, word2000;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
NewTable,myRange,Word, Doc:OleVariant; //, Fields
i:integer;
Align,ShowFirst
levariant;
begin
try
Word:=CreateOleObject('Word.Application');
except
application.MessageBox('请安装Microsoft Word 2000 或更高版本!','警告!',mb_ok+mb_iconwarning);
abort;
end;
Word.Visible:=True;
//创建空文档;
Word.Documents.Add();
//将页面改为“横向”;
Word.ActiveDocument.TrackRevisions := Not Word.ActiveDocument.TrackRevisions;
end;
end.