在Roych代码的基础上帮你改造下:
在标准模块中:
Function TrimString(str As String) As String
Dim strArray() As String
Dim strTemp As String
Dim i As Integer
strArray = Split(str, vbCrLf)
For i = 0 To UBound(strArray)
strTemp = strArray(i)
If Len(strTemp) > 23 Then strTemp = Left(strTemp, 20) & "..."
TrimString = TrimString & strTemp & vbCrLf
Next i