|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
wxhui (风神) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2004/7/29 11:37:25 |
标题: |
有关WORD的操作----如何查找替换。在线等待。。。。。 |
浏览:1199 |
|
加入我的收藏 |
楼主: |
在delphi中操作word时,用下面过程可以实现文本的查找并替换,过程如下: procedure TForm1.replaceClick(Sender: TObject); var SearchText, ReplaceText, All: OleVariant; findtext, matchcase, matchwholeword, matchwildcards, matchsoundslike, matchallwordforms, forward, wrap, format, replacewith, replace, matchkashida,matchdiacritics,matchalefhamza,matchcontrol: olevariant; begin findtext := 'test'; matchcase := false; matchwholeword := true; matchwildcards := false; matchsoundslike := false; matchallwordforms := false; forward := true; wrap := wdfindcontinue; format := false; replacewith := 'ts'; replace := true;//wdReplaceAll; worddocument1.range.find.execute( findtext, matchcase, matchwholeword,matchwildcards, matchsoundslike, matchallwordforms,forward,wrap, format, replacewith, replace,matchkashida, matchdiacritics,matchalefhamza,matchcontrol ); end;
但是有一个问题,就是这样只能把你找到的文字替换为长度在255字节内的文本,有那位大侠可以突破此限制,能把要替换的文字替换为更长的内容?
请各位大侠不吝赐教!
----------------------------------------------
大家好!! |
作者: |
|
2004/7/29 12:19:07 |
1楼: |
那就要看Word是否支持长文本的替换了,你查一下Word的帮助看看.
----------------------------------------------
-广袤璀璨的银河,永无止境的梦想(梦无止境游银河) 博客挂了……
|
|