首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi怎么在TWordApplication中选中文字

2012-03-21 
delphi如何在TWordApplication中选中文字求教delphi如何在TWordApplication中选中文字!另外,我还需要另一

delphi如何在TWordApplication中选中文字
求教delphi如何在TWordApplication中选中文字!

另外,我还需要另一种更高要求的选中文字的方法:我要选中【和接下来出现的第一个】之间的字符并包两个括号本身,然后进行我要的操作,比如改颜色。有没有大大能告诉我的,不胜感激!

[解决办法]
我大概写了一些,你试试吧

Delphi(Pascal) code
  ARange: Range;begin    ARange := WordApp.activedocument.Range(EmptyParam, EmptyParam);    sContent := WordApp.activedocument..Content;    x := pos( '【', sContent );    y := pos( '】', sContent );    ARange.Start := x;    ARange.End_ := y;    ARange.Select;end; 

热点排行