how to export a word document in asp.net using c#.,
admin form
empid : 14
sysno : 7
task : design
these are inserted by admin
in employee form it should b open in a word document ., how
selvi.s
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kyle StoryPosted Dec 1, 2014, 4:38 AM
If you do not have MS Office on server, where your ASP.NET application is hosted, you will not be able to use Word Interop in .NET.
In that case there are few options you can try, for example you can use this .NET component for word files together with a template file.
That would be one of the simplest ways and additionally you could import that admins data via mail merge process in C#, something like this:
And last you can simply export your DOCX file in ASP.NET to the employee like the following:
Jignesh TrivediPosted May 9, 2012, 3:29 AM
you can with Introp dll which are inbuild in vs2010.
use Microsoft.Office.Interop.Word;
try below code.
Application WordApp = new Application();
Document document = WordApp.Documents.Add(ref missing, ref missing, ref missing, ref missing);
Range rng = document.Range(ref start1, ref missing);
rng.Font.Name = "Arial";
hope this help.rng.InsertAfter("Hi, this is Jignesh Trivedi.");
object filename = @"D:\MyTestDoc.doc";
document.SaveAs(ref filename, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
WordApp.Visible = true;
selvi subramanianPosted May 9, 2012, 2:55 AM
Nitesh KejriwalPosted May 9, 2012, 2:08 AM