请自行研究,这一部分知识学会了还是有用的,主要看ole相关部分
http://www.delphibbs.com/delphibbs/dispq.asp?lid=737517
以下部分是我从程序中节选出来的并不完整仅供参考
uses comobj, Variants, word2000;
...
var
Word, stdDoc, cmpdoc, stdtmp, cmptmp: OLEVariant;
...
try
word := GetActiveOleObject('word.application');
except
try
word := CreateOleObject('word.application');
except
showmessage('打开word出错');
end;
end;
Word.Visible := False; //True;
stdDoc := CreateOleObject('Word.Document');
...
//查找四号红色格式
function findreplace(scr: variant): Boolean;
begin
scr.activate;
scr.application.selection.Find.ClearFormatting;
scr.application.selection.find.Font.size := 14;
scr.application.selection.find.Font.Color := wdColorRed;
scr.application.selection.Find.Forward := True;
scr.application.selection.Find.Format := True;
scr.application.selection.find.Execute;
result := scr.application.selection.find.found;
end;