With Word, can VBA identify chr(160) as an unbreakable space, different from chr(32), a normal space?

I am working with VBA in Word to analyze all the words in a given document and I want it to recognize numbers written as strings. My goal is to get the program to recognize that not only are "21" and  "twenty-one" numbers, but "vingt et un" and "ein und zwanzig" are numbers too. The program solves that by putting in unbreakable spaces to make such multi-word numbers single units that the program recognizes.
     My problem is that if I save the revised document so that I will not have to add those spaces the next time I run my program on the text, the program cannot see that "vingt@et@un" (where @ is an unbreakable space) is different from "vingt et un".  
     I do not want to change the spaces to some other character, because I want the document to look the same as it did before the program added the unbreakable spaces.
     I suspect the problem is unsolvable. Any suggestions to the contrary are most welcome.
     John Robin (in Priddis, Alberta)
JohnRobinAllenRetired professor of FrenchAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Martin LissOlder than dirtCommented:
If chr(Mid$(MyString,MyCharacterPosition,1)) = 160 Then...
0
Martin LissOlder than dirtCommented:
Sorry, it should be

If Asc(Mid$(MyString,MyCharacterPosition,1)) = 160 Then...
0

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
JohnRobinAllenRetired professor of FrenchAuthor Commented:
That is exactly what I wanted. Thanks.
     If it is of any interest to see how I implemented the solution, here is the code I used. Note that z() is a string array holding a series of expressions that have what should be unbreakable spaces. The "With Selection" and "With Find" are not closed since I need them for subsequent lines of code:
With Selection
            x = "vingt et un|trente et un|quarante et un|cinquante et un|ein und |zwei und |drei und |vier und und |fünf und |sechs und |sieben und |acht und |neun und |"
            x = x & "treinta y |cuarenta y |cincuenta y |sesenta y |setenta y |ochenta y |noventa y"
            z() = Split(x, "|")

            With .Find
                  .ClearFormatting
                  .Forward = True
                  .MatchCase = False
                  For i = 0 To UBound(z)
                        Selection.HomeKey Unit:=wdStory
                        .Text = z(i)
                        Do
                              .Execute
                              If .Found Then
                                    If InStr(Selection, Chr(160)) = 0 Then
                                          .Text = " "
                                          .Replacement.Text = "^s"
                                          .Execute Replace:=wdReplaceAll
                                          .Text = z(i)
                                    End If
                              End If
                              If .Found = True Then
                                    Selection.Collapse wdCollapseEnd
                              End If
                        Loop While .Found
                  Next i

Open in new window

I consider the question now closed with full points awarded to Martin Liss.
     --JRA in Priddis, Alberta, Canada
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

JohnRobinAllenRetired professor of FrenchAuthor Commented:
I'm grateful to Martin, even though my implementation of his solution differed a bit from his. Because of my particular problem, I was able to simplify the solution..
0
Martin LissOlder than dirtCommented:
Please don't forget to select one or more answers and then close the question.
0
JohnRobinAllenRetired professor of FrenchAuthor Commented:
Sorry for the delay in closing this. I thought I had closed it. --j.r.a.
0
Martin LissOlder than dirtCommented:
I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
0
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
VBA

From novice to tech pro — start learning today.