Find and delete a variable number of spaces following paragraph character

I receive some documents every week that need reformatting. They come with a mixture of non-breaking spaces and normal spaces at the beginning of each paragraph. I could use a simple Find & Replace (optionally embedded in a macro) to find the spurious characters and delete them but their number and distribution ae not the same week to week.

What I need is a few lines of code that find a paragraph mark and then somehow check each subsequent character and if it's a space delete it, continuing until a character in the range [A-Z] is reached. I will pre-process the docs to change all non-breaking spaces into normal spaces.

I'm working in Word 2003.

Thanks in advance.
Dave SwarthoutAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


pls try (using wildcards)
in Find what:

Open in new window

in Replace with

Open in new window

Shaun VermaakTechnical SpecialistCommented:
Have you tried an "Advanced Search" with

Open in new window

or you could try (without wildcards)
Find what

Open in new window

replace with

Open in new window

so you do not have to change the non-breaking spaces in "normal" spaces
As a macro
Sub Macro()
Set rng = ActiveDocument.Range
With rng.Find
    .Text = "^013^w"
    .Replacement.Text = "^p"
    .Execute Replace:=wdReplaceAll
End With
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave SwarthoutAuthor Commented:
Thanks much. That macro worked wonderfully.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.