Revert, WritePasswordDocument, WritePasswordTemplate, Format );
{Assign WordDocument component}
ItemIndex := 1;
WordDocument.ConnectTo(WordApplication.Documents.Item(ItemIndex));
{Turn Spell checking of because it takes a long time if enabled and slows down
Winword}
WordApplication.Options.CheckSpellingAsYouType := False;
WordApplication.Options.CheckGrammarAsYouType := False;
end;
让Word替换标记字符串要使用WordDocument.Range.Find.Execute,这里用Delphi替换了
<#Name>:
var
FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike,
MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace: OleVariant;
begin
FindText := ’<#Name>’;
MatchCase := False;
MatchWholeWord := True;
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/