Code: Select all
Function strStripControls(ByVal strIn As String) As String
While Asc(Right(strIn, 1)) < 32
' Debug.Print Asc(Right(strIn, 1))
strIn = Left(strIn, Len(strIn) - 1)
Wend
strStripControls = strIn
'Sub TESTstrStripControls()
' Debug.Print "**" & strStripControls(ActiveDocument.Paragraphs(1).Range.Text) & "**"
'End Sub
End Function
This morning it dawned on me that it didn't matter what the character was, what mattered was that I didn't want it.
An interesting philosophical point, for sure.
http://www.asciitable.com/