Free Support Forum - aspose.com

Want to take the .net page value to word document

Hello All,

I hv one asp.net page it cotains the Textboxes and Some other Controls. when i click on export to word button the all text in thats controls is added in word document.

If the textbox cotains the the text is bold / italic / underline same way the contents are copy in to word document …How to do this


Can you help me please ! …

Its urgent


Thanks
Regards
Rahul

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. It is not quite clear for me what you need to achieve. Could you be more specific?

If you need to generate Word document according to the content entered in the textboxes on your Web page, then maybe you should consider mail merge feature. Please follow the link to learn more:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/simple-mail-merge-explained.html

Best regards.

Hello I want export asp.net page to word How to acheive this ?

Please see the attachment file.

If i added controls contains the Text Like Hello How are you ?

I want same content can copy in word file

How to take the textbox value ?
how to take the value in grid , datalist control ?



Help Me its urgent

Please see the attachment u can clear the idea what i want ?


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. It seems you use some king of reach text editor on your page. Usually such editors works with HTML, so you can just get HTML from the reach text editor and insert this HTML into Word document using InsertHtml method.

mahajanrahuld:

How to take the textbox value ?
how to take the value in grid , datalist control ?

These questions are not related to Aspose.Words. From your code you can work with controls on your page and get their values.

Best regards.

Hello

I want to take the aspx page value into msword file ?
means If textbox contain Hii then diplay hiii In word file
if datalist contain some value that value diplay in word file


How to do this using aspose word


Thanks
Regard
Rahul

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You can just get necessary value from your page and insert it into the document using DocumentBuilder for example:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/documentbuilder-overview.html

Best regards.

Hello dear not clear… can u please give one sample code

eg.

Please see the attachment of this post . It contains 2 textbox how to take this 2 value
1 Rahul M : Name
2 232323 : PHone number

how to take this 2 value in to word

can u please give me sample




Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You can also use Mail Merge to fill the document with data from your Web form. Please see API reference for more information:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/simple-mail-merge-explained.html

The code is very simple:

// Open template

Document doc = new Document(Server.MapPath("in.doc"));

// Create array that contains names of mergefields in the template

string[] names = {"Name", "City", "Company"};

// Get values from textboxes on the web form

object[] values = {txtName.Text, txtCity.Text, txtCompany.Text};

// Execute simple mail merge

doc.MailMerge.Execute(names, values);

// Send output document to client side

doc.Save("out.doc", SaveFormat.Doc, SaveType.OpenInWord, Response);

I also attached simple Web application. I hope this could help you.

Best regards.

Hello m using simple mail merge command , i hv genrate the msword document but m using Radeditor in that application using Radeditor.Content , it will return HTML formated output, directely pasted the HTML content in word.

input is dfadfafasf

using Radediotr.Content it wil written in word

dfafafaf
fsafasfasf


Document doc = new Document(Server.MapPath(“inn.doc”));


// Create array that contains names of mergefields in the template

string[] names = { “Title”, “First_Name”, “Last_Name”, “Company_Name”, “Address_Line_1”, “City”, “State”, “Zip_Code”, “Home_Phone”, “Email_Address”, “Message” };



// Get values from textboxes on the web form
object[] values = { txttitle.Text, txtfname.Text,txtlname.Text,txtcompany.Text,txtaddress.Text,ddlcity.SelectedValue,txtstate.Text,txtzip.Text,txtphone.Text,txtemailid.Text, RadEditor1.Content };

// Execute simple mail merge
doc.MailMerge.Execute(names, values);

// Send output document to client side
doc.Save(“out.doc”, SaveFormat.Doc, SaveType.OpenInBrowser, Response);

}

out is after clicking button is

Title : Mr. First Name : Rahul Last Name : Mahajan

Company Name : sss

Address : sss City : Mumbai State : maharashtra

Zip Code : 1131321 Home Phone : 123132123

Email ID : mahajanrahuld@gmai..com

Message :

fsafsafasfas


sfsf

asf

asfsaf

asf

asfas

fas

howm to convert HTML content to word

Thanks you


URGENT


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You can use MergeField event handler to achieve this. Here you can find example, which shows how to insert HTML during mail merge:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.reporting.mergefieldeventhandler.html

Hope this helps.

Best regards.

perhaps redirect to the correct link?

again only goes to the program guide...please provide example or correct the link

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request and my apologizes for inconvenience. The link was broken after refactoring our documentation some time ago. Here is correct link to this article:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.reporting.mergefieldeventhandler.html

Hope this helps. Please let me know if you need more assistance, I will be glad to help you.

Best regards.