View Single Post
  #6   Report Post  
Venky62 Venky62 is offline
Junior Member
 
Posts: 19
Default

I was searching for some such trick. That is, convert numerals to words.

Microsoft has given code for a function SpellNumber that can be used directly in Excel VBA module. But it needs to be modified for using in Word.

In this connection I want to know how I can locate numerals in a selection and then replace them with words. A selection may have one numeral or several numerals. My goal is to write code to convert all the numerals into words. I have written code to do this for the whole document, but I am running into problem when trying to use it for selected text.

The problem is, when you use the Find method, the Selection.Range changes. So my question is: is there a way to preserve range of the Selected text during multiple iterations of code?

The tedious way of doing that is by iterating through each word in the selected text until the last word of the selection is reached. Is that the only way?

I am posting for the first time, and I hope I have posted in the right forum, right thread, and that my query is clear. thanks.

Quote:
Originally Posted by zslutzky View Post
Thanks,

Next time I'll try that. Although it would be nice to have a feature you
could instantly switch on or off to convert the numerals.