Results 1 to 3 of 3

Thread: Interop word: How to search in a range for one result per Execute()?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    74

    Interop word: How to search in a range for one result per Execute()?

    I use Find.Execute() method to search some keyword in the following text in a word document.

    a b c d e f 1, a b c d e f 2, a b c d e f 3.

    and the search keyword is "a", I want the Execute() return when it finds the first "a". Then in the next Execute() it returns second "a", and in the third Execute() it returns the third "a".

    The parameters for Find.Execute() are: MatchWholeWord, (search) Forward, wdFindStop for Wrap.

    However after running the Execute() once, it will search whole text and return 3 "a". What should I do to enable the Execute() method return immediately when it finds the first "a", and in next Execute() it returns second "a"?

    Thanks for help!
    Last edited by tommeal; Apr 28th, 2011 at 08:04 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width