Application.CleanString (Word)

Removes nonprinting characters (character codes 1–29) and special Word characters from the specified string or changes them to spaces (character code 32). Returns the result as a String.

The following characters are converted as described in this table.

CleanString (String)

String: The source string.


Dim strClean As String 
Dim docNew As Document 
 
strClean = Application.CleanString(Selection.Text) 
Set docNew = Documents.Add 
docNew.Content.InsertAfter strClean