uses 里加入word97
procedure openwordfile(Myword:TWordApplication;Myfile:string);//打开Word文档函数。
//Myword:文档工程名称;Myfile:word文件名。
var
ItemIndex :OleVariant;
FileName, ConfirmConversions, ReadOnly, AddToRecentFiles,
PasswordDocument, PasswordTemplate, Revert,
WritePasswordDocument, WritePasswordTemplate, Format,
MatchCase,MatchWholeWord,find1,rep1,
MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward,
Wrap, Replace : OleVariant;
begin
Myword.Visible := false;
FileName :=MyFile;
confirmConversions := False;
ReadOnly := False;
AddToRecentFiles := False;
PasswordDocument := '';
PasswordTemplate := '';
Revert := True;
WritePasswordDocument := '';
WritePasswordTemplate := '';
Format := wdOpenFormatDocument;
myWord.Documents.Open( FileName, ConfirmConversions,
readOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate,
Revert, WritePasswordDocument, WritePasswordTemplate, Format );
myword.Visible:=true;
end;
//打开Word文档函数(结束)