Group: microsoft.public.word.vba.general
From: Helmut Weber
Date: Saturday, March 29, 2008 7:55 PM
Subject: Re: Insertion of nonbreaking space between a number and the degrees character (° ANSI value 176)

Hi Andreas,

in case that there is only one ordinary space chr(32)
between a digit and "°C":

Sub Test002()
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
With rDcm.Find
.Text = "([0-9]) (°C)"
.Replacement.Text = "\1^0160\2"
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub

In case that there is nothing between
the digit and "°C" or more than one ordinary space,
things get complicated.

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP

Safety Articles | Usenet Groups | Usenet News | Bluegrass