I am new to programming and need some help.
Im using VB 2010 express and Im trying to read the .rtf file for a string, then find and replace the text inside it and finally output as a new file
I managed to do this using the code below, BUT it loses formatting a carriage return, and the output is all on the same line?
thanks for any help james
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
Dim fileReader As String
fileReader = My.Computer.FileSystem.ReadAllText("C:\Testing\Reports\test2.rtf")
fileReader = fileReader.Replace("@@HCO@@", RichTextBox1.Text)
Dim StreamW As New IO.StreamWriter("C:\Testing\Reports\test3.rtf")
StreamW.Write(fileReader)
StreamW.Close()
source
share