Group: microsoft.public.word.vba.general
From: "Doug Robbins - Word MVP"
Date: Saturday, March 29, 2008 7:45 PM
Subject: Re: Insertion of nonbreaking space between a number and the degrees character (° ANSI value 176)

Recorded Code:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "°C"
.Replacement.Text = "^s°C"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"andreas" wrote in message
news:1593959f-668c-48be-a75f-18f3fca58749@h11g2000prf.googlegroups.com...
Dear Experts:

I would like to be able to automatically insert a nonbreaking space
between all instances of a number and the character set °C (ANSII
Value of 176) using VBA. For example:

40 °C or 5 °C

I know how to do it using the Find And Replace Dialog Field. But I
also would like to be able to do it programmatically. The "Find.Text"
Line is enough.

Help is appreciated.


Thank you very much in advance.

Regards,

Andreas


Safety Articles | Usenet Groups | Usenet News | Bluegrass