I thought I was out of the woods of requiring to manually alter the RTF codes of the data in a richtextbox control in my project. I was wrong...
I need to alter the margins so that the file is formatted correctly when viewed in some external application such as WordPad or MS Word. I need to insert the "\margl", "\margr", etc. codes manually. At first, I tried altering the TextRTF property, but it doesnt save (re: http://support.microsoft.com/support/kb/articles/Q184/1/98.asp
If I alter the TextRTF property and set it back, its gone as immediately as it was set (if it ever was.) So why not just store it in a string variable you ask? For a couple of reasons:
1) The final document is over 6MB in size and storing the data in that variable and then manipulating the string thereafter is a huge memory and CPU hog
2) Trying to write that string to disk using the Print# statement is horrible in performance against the richtextbox's intrinsic SaveFile method.
So I need to alter the rtf codes, which only need to be inserted near the beginning of the document. I am hoping there is some slick CopyMemory routine to insert the codes I need or something similar. Please help!!