i have a problem in writing in word document the proble is that i want to append a string after a table i made in that document but it overides it...
Ok, your text is being appended to the word document, as you have told it to do. The problem is how Word is interpreting the document. When debugging, I saw that the string "hank" was indeed getting in the document, so I played with some formatting changes in the code and used BinaryWriter instead of StreamWriter so I could position the stream 1 position away from the EOF:
//StreamWriter sWriter = new StreamWriter(fStream);
BinaryWriter sWriter = new BinaryWriter(fStream);
sWriter.Seek(1, SeekOrigin.End);
sWriter.Write("hany}");
Now, Word will display the appended text on a new page. Notice the addition of the closing brace in the text: "hany}". That is because I overwrote the closing brace already existing in the file (with Seek) and I wanted word to see "hany" before the final closing brace.
What you are dealing with at this point is Word scripting and you need to figure out how you can modify word documents externally or use some library that facilitates doing so, instead of using standard stream writers.
If the word "hany" is all you need appear at the end of the doc, and you wanted it to appear on the same page, you might be able to modify the export options to not fill the entire page with the table, then simply use the quick fix I just gave you.
Does this make sense?