RichTextBox to Text file?

daveofgv

Well-known member
Joined
Sep 17, 2008
Messages
218
Location
Dallas, TX
Programming Experience
1-3
I have a My.Settings file that has a folder path that the user will select.

I need to export text from a RichTextBox to a file, however, I can't seem to figure out how to use My.Settings as the path where the text file will be created.

Right now, I have:
VB.NET:
Me.txtlog.SaveFile("C:\Users\mycomputer\Desktop\New folder\founditems.txt", RichTextBoxStreamType.PlainText)

which works fine, however, the My.Settings.destfolder is "C:\Users\mycomputer\Desktop\testfolder\"

I have tried:
VB.NET:
Me.txtlog.SaveFile(My.Settings.DestinationFolder, RichTextBoxStreamType.PlainText)

but it doesn't work - and also I do not know how to name the text file from the above code.

Can anyone give me some advise?

Thanks in advanced
 
No.... I just figured it out.....
VB.NET:
Me.txtlog.SaveFile(My.Settings.DestinationFolder & "\Test.txt", RichTextBoxStreamType.PlainText)
When you said replacing a file path with a folder path made me think for a minute.

Thanks
 
Back
Top