Dim wordApp As New Application() Dim filePath As Object = "H:\TestDocument.docx" Dim missing As Object = System.Reflection.Missing.Value Dim wordDoc As Document = wordApp.Documents.Add(missing, missing, missing, missing) wordDoc.Activate() wordDoc.Content.InsertBefore("This is Word document created in ASP.NET") wordDoc.Content.InsertParagraphAfter() wordDoc.SaveAs(filePath) wordApp.Application.Quit(missing, missing, missing)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)