Click here to Skip to main content
15,914,642 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to serialize static members of a class? Pin
MohammadAmiry26-May-10 3:07
MohammadAmiry26-May-10 3:07 
Questionmouse right click on a control in .net 2.0 Pin
prasadbuddhika26-May-10 0:14
prasadbuddhika26-May-10 0:14 
AnswerRe: mouse right click on a control in .net 2.0 Pin
Johnny J.26-May-10 0:16
professionalJohnny J.26-May-10 0:16 
AnswerRe: mouse right click on a control in .net 2.0 Pin
Abhinav S26-May-10 0:51
Abhinav S26-May-10 0:51 
QuestionDatagridview Split Pin
Rohit Kumar Mumbai26-May-10 0:08
Rohit Kumar Mumbai26-May-10 0:08 
AnswerRe: Datagridview Split Pin
Peace ON26-May-10 0:18
Peace ON26-May-10 0:18 
QuestionHow to merge my content with a existing word document. Pin
Exelioindia25-May-10 23:22
Exelioindia25-May-10 23:22 
AnswerRe: How to merge my content with a existing word document. Pin
Peace ON25-May-10 23:40
Peace ON25-May-10 23:40 
Following code will help you..

C#
StringBuilder strBuilder = newStringBuilder();
strBuilder.Append("<h1 title='Header' align='Center'>Writing To Word Using ASP.NET</h1> ".ToString());
strBuilder.Append("<br>".ToString());
strBuilder.Append("<table align='Center'>".ToString());
strBuilder.Append("<tr>".ToString());
strBuilder.Append("<td style='width:100px;color:green'><b>amiT</b></td>".ToString());
strBuilder.Append("<td style='width:100px;color:red'>India</td>".ToString());
strBuilder.Append("</tr>".ToString());
strBuilder.Append("</table>".ToString());
// string strPath = Request.PhysicalApplicationPath + "\\document\\Test.doc";
string strPath = filename;
//string strTextToWrite = TextBox1.Text;
FileStream fStream = newFileStream (strPath,FileMode.Append);
fStream.Close();
StreamWriter sWriter = newStreamWriter(strPath);
sWriter.Write(strBuilder);
sWriter.Close();


Find following links for more help...

http://www.daniweb.com/forums/thread210396.html[^]

http://devpinoy.org/blogs/keithrull/archive/2007/05/23/how-to-merge-multiple-microsoft-word-documents-in-c.aspx[^]

http://csharpdotnetfreak.blogspot.com/2009/06/read-write-word-filestream-streamwriter.html[^]

HTH
Jinal Desai - LIVE
Experience is mother of sage....

QuestionBest way to read a file?? Pin
Muammar©25-May-10 22:17
Muammar©25-May-10 22:17 
AnswerRe: Best way to read a file?? Pin
Richard MacCutchan25-May-10 22:55
mveRichard MacCutchan25-May-10 22:55 
GeneralRe: Best way to read a file?? Pin
Muammar©28-May-10 8:17
Muammar©28-May-10 8:17 
GeneralRe: Best way to read a file?? Pin
Richard MacCutchan28-May-10 22:05
mveRichard MacCutchan28-May-10 22:05 
QuestionLoad PDF inside the .Net Application Pin
Fakeer25-May-10 21:35
Fakeer25-May-10 21:35 
AnswerRe: Load PDF inside the .Net Application Pin
Mycroft Holmes25-May-10 22:43
professionalMycroft Holmes25-May-10 22:43 
AnswerRe: Load PDF inside the .Net Application Pin
Johnny J.25-May-10 22:46
professionalJohnny J.25-May-10 22:46 
AnswerRe: Load PDF inside the .Net Application Pin
Abhinav S25-May-10 23:09
Abhinav S25-May-10 23:09 
QuestionIQueryable to DataTable [modified] Pin
ezeljko25-May-10 20:01
ezeljko25-May-10 20:01 
AnswerRe: IQueryable to DataTable Pin
Abhinav S25-May-10 20:08
Abhinav S25-May-10 20:08 
AnswerRe: IQueryable to DataTable Pin
Peace ON25-May-10 20:17
Peace ON25-May-10 20:17 
GeneralRe: IQueryable to DataTable Pin
ezeljko25-May-10 21:07
ezeljko25-May-10 21:07 
QuestionMessage Removed Pin
25-May-10 19:15
Samiul Aman25-May-10 19:15 
Answer[Repost]: UserControl/TreeView Problem....Not getting result during runtime.. Pin
Sandeep Mewara25-May-10 19:43
mveSandeep Mewara25-May-10 19:43 
QuestionHELP!!!!!!!!!!!!!!HELP>>> Pin
linkent8825-May-10 17:51
linkent8825-May-10 17:51 
Answerstupid subject line Pin
Luc Pattyn25-May-10 18:09
sitebuilderLuc Pattyn25-May-10 18:09 
AnswerRe: HELP!!!!!!!!!!!!!!HELP>>> Pin
Abhinav S25-May-10 19:57
Abhinav S25-May-10 19:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.