Hi,
Sounds like a wildcard search would be simpler for what you're trying to do:
Edit > Find, Check "Match wildcards",
Find what: <[a-zA-Z0-9]\-^32
Likely you can achieve whatever you want to do next with a replacement, or
take it from there.
re 1):
What do you mean with "position"... a Range? The character count from the
beginning of the range up to that word? The word count?
It could be something as simple as Selection.Words(1).Start ... or look at
http://word.mvps.org/FAQs/MacrosVBA/GetIndexNoOfPara.htm
re 2):
You could look at "Like" in the VBA help.
The word preceeding the one you have selected would be
Selection.Words(1).Previous.Words(1)
But as suggested above, you might take a step back and describe what your
text looks like and what you want to achieve. Dealing with "words" in the
Word object model would probably be the slowest and most cumbersome way to
go about it.
> one word after the selected word is a space(" ")
A space is never regarded as a word by itself... Spaces belong to the word
preceeding it.
Regards,
Klaus
> Hello, I would like to:
>
[quoted text clipped - 9 lines]
>
> thanks for your help.