Inserting text to web form


#1

I’m using Aspose to build a word document and insert text into that document from a c# web application,now i knowthat i can do that in c# windows application but is it doable in web application?
thanks


#2

Hi,

Thank you for considering Aspose.

Undoubtedly. Aspose.Word can be used in any type of the .NET applications since it is a regular .NET component.


#3

Helllo
But i did use the code to open word document and insert datatable or even plain text ,it didn’t do it.


#4

Please post the code you used. I assure you it's no matter whether the application you used Aspose.Word in is Web or WinForms or something else.


#5

here is the code

DataTable word = new DataTable()
word = (DataTable)Session[“dtAdd”];
Aspose.Word.Word app = new Aspose.Word.Word();
Aspose.Word.Document doc = new Aspose.Word.Document();
doc = app.Open(“c:\Proposal.doc”);
doc.MailMerge.ExecuteWithRegions(word);
doc.Save(“c:\Proposal.doc”, Aspose.Word.SaveFormat.FormatDocument );

thanks


#6

You should not use the Word class becuase it is obsolete. Use the Document constructor instead:

Aspose.Word.Document doc = new Aspose.Word.Document();
doc.MailMerge.ExecuteWithRegions(word);
doc.Save(“c:\Proposal.doc”, Aspose.Word.SaveFormat.FormatDocument )