delphi+word处理报表的问题
espp 2006-03-06 10:47:09 让Word替换标记字符串要使用WordDocument.Range.Find.Execute
下面的例子中用“Delphi”替换了“VB”:
var
FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike,
MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace: OleVariant;
begin
FindText := 'VB';
MatchCase := False;
MatchWholeWord := True;
MatchWildcards := False;
MatchSoundsLike := False;
MatchAllWordForms := False;
Forward := True;
Wrap := wdFindContinue;
Format := False;
ReplaceWith := 'Delphi';
Replace := True;
WordDocument.Range.Find.Execute( FindText, MatchCase, MatchWholeWord,
MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward,
Wrap, Format, ReplaceWith, Replace );
上面的代码是替代word中特定字符的,但是word替代的时候是有字数限制的,好像是500个字符,超出之后会出错,不知道有没有什么设置可以改掉这个限制