相关文章推荐
健身的冲锋衣  ·  android - What is the ...·  1 年前    · 
发呆的骆驼  ·  python - Pandas, ...·  1 年前    · 
俊逸的罐头  ·  mysql sql 解析json sql ...·  1 年前    · 

從指定的字串中移除 (字元碼 1–29) 和特殊 Word 字元的非列印字元,或將它們變更為空格 (字元碼 32) ,如一節中所述。 會以 String 傳回結果。

expression CleanString ( _String_ )

表達 代表 ' Global ' 物件的變數。 選用。

必要/選用 strClean = Application.CleanString(Selection.Text) Set docNew = Documents.Add docNew.Content.InsertAfter strClean

此範例會從選取的功能變數代碼中移除非列印字元,然後顯示結果。

ActiveDocument.ActiveWindow.View.ShowFieldCodes = True 
ActiveDocument.Fields(1).Select 
MsgBox Application.CleanString(Selection.Text)

Global 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應