给出一个例,按你的需要自行修改。
procedure TForm1.Button3Click(Sender: TObject);
var
Itemindex, format, TempEmpty: olevariant;
filename, passworddocument, passwordtemplate: olevariant;
writepassworddocument, writepasswordtemplate: olevariant;
confirmconversions, readonly, revert, addtorecentfiles: olevariant;
n:byte;
begin
if not OpenDialog1.execute then
exit;
{open document}
filename := OpenDialog1.filename;
confirmconversions := false;
readonly := false;
addtorecentfiles := false;
revert := true;
passworddocument := '';
passwordtemplate := '';
writepassworddocument := '';
writepasswordtemplate := '';
format := wdopenformatdocument;
Wordapplication1.documents.open(filename, confirmconversions,
readonly, addtorecentfiles, passworddocument, passwordtemplate,
revert, writepassworddocument, writepasswordtemplate, format, TempEmpty, TempEmpty);
itemindex := 1;
doc.connectto(Wordapplication1.documents.item(itemindex));
wordapplication1.visible := true;
ARange := Doc.Range(EmptyParam, EmptyParam);
Pars := Doc.Paragraphs;
n:=Pars.Get_Count;//打开的文档共有n个段
ARange := Pars.Item(2).Range;
showmessage(Arange.text);//显示第二段的内容--例
end;