打开WORD文件var
FileName: OleVariant;
begin
FileName := 'C:/My Documents/The file I want to open.doc';
Word.Documents.Open(FileName, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam);
关闭
var
SaveChs: olevariant;
begin
SaveChs := wdSaveChanges;
Word.ActiveDocument.Close(SaveChs, EmptyParam, EmptyParam);
插入文本
var
S: Selection;
...
S :=Word.Selection;
S.TypeText('Here is some text');
S.TypeParagraph;
S.TypeParagraph;
S.TypeText('And there was a blank line.');
更多的看
http://www.djpate.freeserve.co.uk/AutoWord.htm