Function FormatString(ByVal StringToFormat As String, ByVal MaxLineLen As Integer) As String Dim TempString As String Dim Pos As Long FormatString = "" Pos = 1 While StringToFormat <> "" If Len(StringToFormat) <= MaxLineLen Then TempString = Trim(StringToFormat) Else TempString = Mid(StringToFormat, Pos, MaxLineLen + 1) TempString = Trim(Left(TempString, InStrRev(TempString, " "))) End If FormatString = FormatString & TempString & vbCrLf StringToFormat = LTrim(Right(StringToFormat, Len(StringToFormat) - Len(TempString))) Wend End Function
Sumber : ?
0 comments:
Post a Comment