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个字符,超出之后会出错,不知道有没有什么设置可以改掉这个限制
...全文
155 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
espp 2006-03-08
  • 打赏
  • 举报
回复
我哭阿,那不是要重新来过阿,我程序都基本结束了。。楼上的几位大哥,能不能帮忙想个办法,我现在是长度过大的话我是拆分的,但是在拆分汉字过程中,如果汉字被半个截断,就出现乱码的情况了,能不能智能判断不截断半个汉字。。
智商无下限 2006-03-06
  • 打赏
  • 举报
回复
好像没有办法突破WORD的限制
  • 打赏
  • 举报
回复
想想有没有其它的变通,要想去掉可能比较难。

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧