我試圖在 Outlook 的 VBA 中呼叫 Excel VBA 中可用的方法。我需要以干凈的方式從字串中洗掉空格(以便于維護),所以我認為使用 Excel 中可用的“替換”方法會很容易。由于 Outlook 無法使用命令“Application.WorksheetFunction.Substitute(...)”,我該如何呼叫 Substitute 方法?
偽代碼:
dim string1 as String, string2 as String
string1 = "hello world"
string2 = Substitute(string1, " ", "")
>> string2 = "helloworld"
uj5u.com熱心網友回復:
嘗試做
string2 = Replace(string1, " ", "")
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/513822.html
標籤:擅长vba细绳外表替代
上一篇:無法將陣列寫入作業表