how do I change numbers into words in microsft words

H

hadighan

I am creating a template where I need to have the numbers changed in there
respective words; ex: 256 is two hundred fifty six.
I need this operation to be done by word only
 
D

Doug Robbins

With the insertion point in the number, run the following code:

Dim myrange As Range
Set myrange = Selection.Words(1)
Selection.Fields.Add Range:=myrange, Type:=wdFieldEmpty, _
PreserveFormatting:=False
myrange.Start = myrange.Start + 1
myrange.InsertBefore "="
myrange.InsertAfter "\*cardtext"
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
Selection.Fields.Update


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top