Adding character to the begining and end of a multiline textbox
Adding character to the begining and end of all the values of richtextbox e.g
1234
4567
6789
'1234'
'4567'
'6789'
and export it to a file
Re: Adding character to the begining and end of a multiline textbox
Do you need the quotes in the rtb or only in the file being exported?
Re: Adding character to the begining and end of a multiline textbox
try like
vb Code:
text1 = "'" & replace(text1, vbnewline, "'" & vbnewline & "'") & "'"
this will change the content of the textbox, to output it straight to the file
vb Code:
print #filnum, "'" & replace(text1, vbnewline, "'" & vbnewline & "'") & "'"
if there is an empty line at the end of the textbox omit the last & "'" else it will put a ' at the start of the new line
Re: Adding character to the begining and end of a multiline textbox
I was thinking that if only needed in the exported file then he can use the Write command so it writes double quotes automatically if doubles are ok.
Re: Adding character to the begining and end of a multiline textbox
that would obviously work and may be satisfactory for the requirement, i just tried to answer the original question
Re: Adding character to the begining and end of a multiline textbox
Your suggestion is good too I didnt mean anything by that just presenting another possibility :)