有恒ccs

导航

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();

posted on 2021-10-12 10:19  有恒ccs  阅读(86)  评论(0编辑  收藏  举报