I am guessing would have to use string manipulation functions (Left, Mid, InStr, Len) in looping structure to progressively write substrings of the lengthy text.
What is 'space'? How many characters should be allowed on each line? You don't want words split? Consider (I picked 50 as the line length):
Code:
Function testNotepad(strIn)
Dim strA As String, intP As Integer
While Len(strIn) > 0
If Len(strIn) > 50 Then
intP = InStrRev(Left(strIn, 50), " ") - 1
strA = Left(strIn, intP)
strIn = Mid(strIn, intP + 2)
Else
strA = strIn
strIn = ""
End If
Debug.Print strA
Wend
End Function