public void WriteToFile()
{
string fileName = "TestFile.rtf";
string fileInit1 = @"{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f16\froman\fcharset238\fprq2 Times New Roman CE;}{\f17\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f19\froman\fcharset161\fprq2 Times New Roman Greek;}{\f20\froman\fcharset162\fprq2 Times New Roman Tur;}{\f21\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f28\fmodern\fcharset238\fprq1 Courier New CE;}{\f29\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f31\fmodern\fcharset161\fprq1 Courier New Greek;}{\f32\fmodern\fcharset162\fprq1 Courier New Tur;}{\f33\fmodern\fcharset186\fprq1 Courier New Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{";
string fileInit2 = @"\widctlpar\adjustright \lang2057\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\widctlpar\adjustright \f2\fs20\lang2057\cgrid \sbasedon0 \snext15 Plain Text;}}{\info{\title Angle}{\author SPCC User's}{\operator SPCC User's}{\creatim\yr2003\mo7\dy2\hr8\min1}{\revtim\yr2003\mo7\dy2\hr11\min24}{\version3}{\edmins1}{\nofpages9}{\nofwords2795}{\nofchars15934}{\*\company Sandvik AB}{\nofcharsws0}{\vern37}}\paperw11906\paperh16838\margl1152\margr1152 \widowctrl\ftnbj\aenddoc\hyphcaps0\formshade\viewkind4\viewscale100\pgbrdrhead\pgbrdrfoot \fet0\sectd \linex0\headery709\footery709\colsx709\endnhere\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s15\widctlpar\adjustright \f2\fs20\lang2057\cgrid {";
if( File.Exists(@"../Debug/TestFile.rtf") )
File.Delete(@"../Debug/TestResult.rtf");
FileStream fStream = new FileStream( fileName, FileMode.CreateNew, FileAccess.Write );
BufferedStream bStream = new BufferedStream( fStream );
StreamWriter sWriter = new StreamWriter( bStream );
sWriter.Write(fileInit1 + fileInit2); //start på rtf-kod
sWriter.Write(@"}{\b\f25\fs30 " + "fet stil i fontsize 30" + @" \par }{\f25\fs18"); //f25 = font 25, fs18 = font size 18
sWriter.Write(@" \par "); //ny rad
sWriter.Write(" }}"); //slut på rtf-kod
sWriter.Flush();
sWriter.Close();
}