A
Anachostic
Here's an interesting request. I'm just looking for the most efficient way to handle this.
I have a need to do a find and replace on a text range. The replace is simply a formatting change. However, I need to change the formatting on a specified number of words on either side of the matched word as well.
I am looking at the object model, but figured maybe someone who knows it a bit better could point me right where I needed to go.
My anticipated approach is to match the word, step back x words, start selecting, step forward ((x*2)+1)) words, end selecting, then apply the formatting to the selection. That doesn't sound like the best way to do it.
Maybe I could do a regular expression match? Any other ideas?
I have a need to do a find and replace on a text range. The replace is simply a formatting change. However, I need to change the formatting on a specified number of words on either side of the matched word as well.
I am looking at the object model, but figured maybe someone who knows it a bit better could point me right where I needed to go.
My anticipated approach is to match the word, step back x words, start selecting, step forward ((x*2)+1)) words, end selecting, then apply the formatting to the selection. That doesn't sound like the best way to do it.
Maybe I could do a regular expression match? Any other ideas?