让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;
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 ); end;
这里用delphi替换了< #name> :
var
findtext, matchcase, matchwholeword, matchwildcards, matchsoundslike,
matchallwordforms, forward, wrap, format, replacewith, replace: olevariant;
begin
findtext := '< #name> ';
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 ); end;
解决方案 »
- 50分求win2000自带的红心大战!!!!
- 高手支招:delphi或cb中如何实现vc中atl的IObjectSafe接口
- 字條截取問題!!
- 庆祝自己生日,放分!
- 对Interbase和oracel编程,怎样根据不同的错误代码写相应的错误提示?
- 我的专家分怎么突然少了2000多分,csdn搞什么鬼
- 求助:动态创建窗体后,线程出现错误
- Listview上加载Panel之后,Listview的垂直滚动条消失?
- 大学这四年。。。
- 请不要把我的帖子转到“建议和意见”好吗?
- 如何用delphi开发*.ocx???
- 在一个窗体中有二十几个EDIT控件和几个COMBOBOX和DBLOOKUPCOMBOBOX,我想一下把它们都清空,好象听说有什么数组来着。
这里用delphi替换了< #name> :
var
findtext, matchcase, matchwholeword, matchwildcards, matchsoundslike,
matchallwordforms, forward, wrap, format, replacewith, replace: olevariant;
begin
findtext := '< #name> ';
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 ); end;