Caption = "This function will save text in the textbox to a file called ""MYFILE.TXT"" in the directory that the program is being run from. Probably VB in this case. See the ""CMDIALOG"" sample code for use with printing."
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 1770
Left = 5130
TabIndex = 2
Top = 750
Width = 2145
WordWrap = -1 'True
End
Sub Command1_Click ()
'To use this function with a text box, make sure the
'text box's Multiline property to True, and use the
'following code:
'-- VB functions that take strings as parameters
'will not accept a Text property.
T$ = Text1.Text
'-- Get the formatted text (45 characters wide)
Wrapped$ = WordWrap$(T$, 45)
'-- Save the text to a file.
Open "MYFILE.TXT" For Output As 1
Print #1, Wrapped$
Close #1
End Sub
Function WordWrap$ (St$, Length)
'-- This function converts raw text into CRLF delimited lines.