ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Export DIV html to Word in ASP.Net MVCHi @krish2018,<br />Please try the following<br /><br /><a href = 'link(Threads/150000/Export-HTML-DIV-to-Word-or-PDF-in-ASPNet/)'>Export HTML DIV to Word or PDF in ASP.Net</a><br /><br />It might help you.<br /><br />Cheers Andrea.https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/Wed, 11 Apr 2018 05:30:32 GMTExport DIV html to Word in ASP.Net MVC<p>&nbsp;</p> <pre class="brush: csharp">public static class WordHelper { public static byte[] HtmlToWord(String html) { const string filename = &#34;test.docx&#34;; if (File.Exists(filename)) File.Delete(filename); using (MemoryStream generatedDocument = new MemoryStream()) { using (WordprocessingDocument package = WordprocessingDocument.Create( generatedDocument, WordprocessingDocumentType.Document)) { MainDocumentPart mainPart = package.MainDocumentPart; if (mainPart == null) { mainPart = package.AddMainDocumentPart(); new Document(new Body()).Save(mainPart); } HtmlConverter converter = new HtmlConverter(mainPart); Body body = mainPart.Document.Body; var paragraphs = converter.Parse(html); for (int i = 0; i &lt; paragraphs.Count; i++) { body.Append(paragraphs[i]); } mainPart.Document.Save(); } return generatedDocument.ToArray(); } } } [HttpPost] [ValidateInput(false)] public FileResult Demo(CkEditorViewModel viewModel) { return File(WordHelper.HtmlToWord(viewModel.CkEditorContent), &#34;application/vnd.openxmlformats-officedocument.wordprocessingml.document&#34;); }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/Wed, 11 Apr 2018 05:45:09 GMTExport DIV html to Word in ASP.Net MVC<p>&nbsp;</p> <pre class="brush: csharp">https://www.c-sharpcorner.com/uploadfile/d2dcfc/convert-html-to-word-then-word-to-pdf-with-C-Sharp/</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/Wed, 11 Apr 2018 05:47:57 GMTExport DIV html to Word in ASP.Net MVC<p>Hi <a class="username" rel="krish2018">krish2018</a>,</p> <p>Refer below article.</p> <h1 class="header"><a title="Export Grid (Html Table) data from database to Word in ASP.Net MVC'a" href="https://www.aspsnippets.com/Articles/Export-Grid-Html-Table-data-from-database-to-Word-in-ASPNet-MVC.aspx">Export Grid (Html Table) data from database to Word in ASP.Net MVC</a></h1>https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/Wed, 11 Apr 2018 06:28:35 GMTExport DIV html to Word in ASP.Net MVC<blockquote><cite>dharmendr says:</cite> <p>Hi <a class="username" rel="krish2018">krish2018</a>,</p> <p>Refer below article.</p> <h1 class="header"><a href="https://www.aspsnippets.com/Articles/Export-Grid-Html-Table-data-from-database-to-Word-in-ASPNet-MVC.aspx">Export Grid (Html Table) data from database to Word in ASP.Net MVC</a></h1> </blockquote> <p>&nbsp;Thank U Dharmendr&nbsp;Sir.</p> <p>Your code is proved very useful for me but actually my doc file also contains a photo<br />and this photo is not showing in the downloaded doc file</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/Thu, 12 Apr 2018 01:19:05 GMTExport DIV html to Word in ASP.Net MVC<p>You can't ask multiple queries within a question. This is against forum rules and necessary to maintain clean forum.<br />It is requested Mark Answer the replies when question is answered and ask a new question as a responsible member to help fellow programmers around the world.</p>https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/192827/Export-DIV-html-to-Word-in-ASPNet-MVC/Thu, 12 Apr 2018 03:34:30 GMT