比如 我有一段文字如下(只是举例)
 复仇的火焰开始 hello 在他心底 he 燃烧。 如此的 hit 痛苦,使他从脆弱到坚强。 为了有饭吃,他决 hello 定去当和尚。
我想查找前两段中以 h开头的单词并统计个数
可是每次用find时都会搜索全文或者是只搜索出一个单词就停止请问大家有没有解决办法,在下不盛感激!
拜托各位了!!!

解决方案 »

  1.   

    先谢谢了
    呵呵,因为总共才发了3个贴子,而且都是前不久发的,所以都还没结。
    录制宏的结果是
       Selection.Find.ClearFormatting
        With Selection.Find
            .Text = "&$*$&"
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindStop
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchByte = False
            .MatchAllWordForms = False
            .MatchSoundsLike = False
            .MatchWildcards = True
        End With
        Selection.Find.Execute
        Selection.Find.Execute
        Selection.Find.Execute
     可是我事先并不知道会有多少个以h开头的单词,没有办法决定Selection.Find.Execute执行多少次
      

  2.   

    用循环做一下可以了。Selection.Find.ClearFormatting     With Selection.Find
            .Text = "&$*$&"
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindStop
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchByte = False
            .MatchAllWordForms = False
            .MatchSoundsLike = False
            .MatchWildcards = True
        End WithDo While Selection.Find.Execute 
        '找到目标后要做的事情放在这里,比如计数
    Loop
      

  3.   

    这个宏 怎么写?
      中文设置成 :宋体, 五号字体 
      英文设置成 :Times New Roma, 小四号 
      数字设置成 :Times New Roma,五号 
      

  4.   

    楼主,是这样的,当你查找了一次成功后,你的选择范围(selection)已经变成“查找到的内容”,可能只是一个字母或汉字,这时你继续下一次查找就变成全文查找了。