//******************************creation of word document using openXML concept**************************
string fileName = @"D:\rentformat1.docx";
using (WordprocessingDocument myDocument = WordprocessingDocument.Create(fileName, WordprocessingDocumentType.Document))
{
MainDocumentPart mainPart = myDocument.AddMainDocumentPart();
mainPart.Document = new Document();
Body body = mainPart.Document.AppendChild(new Body());
Paragraph para = body.AppendChild(new Paragraph());
Run run = para.AppendChild(new Run());
run.AppendChild(new Text("hello, world"));
}
string fileName = @"D:\rentformat1.docx";
using (WordprocessingDocument myDocument = WordprocessingDocument.Create(fileName, WordprocessingDocumentType.Document))
{
MainDocumentPart mainPart = myDocument.AddMainDocumentPart();
mainPart.Document = new Document();
Body body = mainPart.Document.AppendChild(new Body());
Paragraph para = body.AppendChild(new Paragraph());
Run run = para.AppendChild(new Run());
run.AppendChild(new Text("hello, world"));
}
No comments:
Post a Comment
Please Give Your Valuable Comments on this Topic