Hi BugHunter,
For reading i have used OpenXml library.
Check this example. Now please take its reference and correct your code.
Namespaces
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
Controller
public class HomeController : Controller
{
// GET: /Home/
public ActionResult Index()
{
string file = Server.MapPath("~/Files/TestWord.docx");
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(file, true))
{
Body body = wordDoc.MainDocumentPart.Document.Body;
string paras = "";
foreach (var paragraph in body)
{
paras += paragraph.InnerText + "<br/>";
}
TempData["Data"] = paras;
}
return View();
}
}
View
<body>
<div>
<%if (TempData["Data"] != null) { %>
<%=TempData["Data"]%>
<% } %>
</div>
</body>
Screenshot