Selection depends too much on various setting the user might be using in Tools | Options. To avoid such issues one has to initialize the envirinment with known settings for, anong others, whether typing replaces selection.Originally Posted by MOS MASTER
Over time, one learns these things from seeing others posts.Off course it's always a good thing to experient with different approaches when you're programming a specific task. (there's almost always a tool that does the job the best)
There are general rules, but oh my there are exceptions as we recently learned reharding te ProofReadingErrors collection.
My experience has been that using Expand is the fastest wat to move thru a Selectio/Range, other things being equal.I was triggerd by you're call that the Range Object with the Expand method would be the fastes way to achieve this.
I've never used this object to do this perticular task so I tried it out..
I'm going to try it in the future on other jobs to see if it's speeding things up.
I'll comment on Tony's case in a response to his reply.
Dag nab it!I'm still wondering if anyone else got another approach on frying this chicken because it still seams to run a little bit slow. (on big documents with lot's of highlighting)
Now I have this urge to eat chicken and I've got none in the house!
For your app, Find will be faster than using Expand because Find has the built-in smarts to look for formatting, highlighting, etc.Originally Posted by TonyJollans
With Exapand, one has to do the testing oneself.
My experience has been that Selection.Find may be faster than Range.Find only when something must selected after being found.As for using the Selection object, I do agree that it should be avoided in general but it is not always the case in Word. In my experience, Find is one of those things which often seems to work best with the Selection; there seem to be some oddities when trying to use it with other Range objects like it is in some way always tied to the Selection.
For your app Find should be faster.I find the Range / Expand approach slightly convoluted in this case although there may be a way to use it effectively. I'm still thinking about other methods