编程语言
首页 > 编程语言> > C#操作word

C#操作word

作者:互联网

Document doc = new Document();          Section sec = doc.AddSection(); Paragraph Para = sec.AddParagraph(); Para.AppendText("通知内容:"+dtView.Rows[0]["NR"].ToString()); doc.SaveToFile(strAttachmentFilePath+ NFILEPATH, FileFormat.Docx);    

FileStream fs = File.Create(@"F:\\TEST2.txt");
StreamWriter sw = new StreamWriter(fs);
sw.Write("ABC");//开始写入值
sw.Flush();
sw.Close();

标签:StreamWriter,word,Para,C#,doc,sw,sec,操作,Document
来源: https://www.cnblogs.com/ccs1998/p/15396600.html