|
让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 );
(出处:清风网络学院)
上一篇:实现高速文件拷贝
下一篇:实现可缩放的无标题窗体
|