Hi there, I have been trying for a many hours how I can append a line to a rtf file.
My program reads from a template and then replaces some values in the template with values from a dataset then save it into another Microsoft Office rtf file. The trouble is, I can replace the values however I cannot put a line break in there.
I have tried System.Environment.NewLine, vbCrlf, "L\n" (ithink this is what i used) and also stringbuilder.AppendLine(string) and stringbuilder.AppendLine
The above works if I was to save the string into a ".txt" extension but it will not work if I save string into ".rtf" or ".doc" extension.
I am hoping someone can help me out.
Thanks
Loading
Sam HobbsPosted Jul 5, 2010, 3:19 AM
A RTF file is all text but it uses special codes for things. I don't know what the RTF code for a new line is but it would be different from all or most all other formats. For example, for HTML we need to use
for a new line. The code for RTF is different and you need to find where the RTF format is explained to determine what the code is.
Amit ChoudharyPosted Jul 5, 2010, 12:43 AM
if you are using response object to generate the output file then use encoding for RTF file or DOC file..
hope you got my point.
Please don't forget to mark my answer if it helps you.