This given below code shows how to merge two word documnts into one word document.But now i want how to merge html and word document into one word document?
public static void MergeTwoWordDoc()
{
Document dstDoc = new Document(@"C:\Test.docx"); //Paper size of this document is A4
Document srcDoc = new Document(@"C:\Test1.docx"); //Paper size of this document is Letter
srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.Continuous;
foreach(Section srcSection in srcDoc)
{
srcSection.PageSetup.PageWidth = dstDoc.LastSection.PageSetup.PageWidth;
srcSection.PageSetup.PageHeight = dstDoc.LastSection.PageSetup.PageHeight;
// Import section
Section newSection = (Section) dstDoc.ImportNode(srcSection, true, ImportFormatMode.KeepSourceFormatting);
dstDoc.Sections.Add(newSection);
}
// Save output
dstDoc.Save(@"C:\TestResult.docx");
}
how to merge html and word document into one word document,pls let me know asap?
Document dst = new Document(@"C:\Test.docx");
Document src = new Document(@"C:\Htmlfile.html");
//--eror in this line unknown file format
dst.AppendDocument(src, ImportFormatMode.KeepSourceFormatting);
dst.Save("out.doc");
Document dst = new Document(@"C:\Test.docx");
Document src = new Document(@"C:\Htmlfile.html");
//--eror in this line unknown file format
dst.AppendDocument(src, ImportFormatMode.KeepSourceFormatting);
dst.Save("out.doc");