TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
gavriel ankri
NA
39
48.4k
Generating Ms Word document in ASP.NET and C#
Mar 3 2012 11:07 AM
Hello.
I am using this code to save asp.net page as an MS Word doc file.
protected void GenerateMsWordDoc(object sender, EventArgs e)
{
string strBody = "<html>" +
"<body>" +
"<table width=\"100%\" style=\"background-color:#cfcfcf; font-family: Arial, Helvetica, sans-serif\"><tr><td>????</td><td>2nd cell body data</td></tr></table>" +
txtName.Text + "</b></div>" +
"Ms Word document generated successfully." +
"</body>" +
"</html>";
string fileName = "MsWordSample.doc";
Response.ContentType = "application/msword";
Response.Charset = "Windows-1255";
Response.AppendHeader("Content-disposition", "attachment; filename=" + fileName);
Response.Write(strBody);
}
}
I have 2 questions:
1. If I write a text in hebrew, I cant see it correctly in the doc file. what should I do ?
2. How can I add image to the doc file ?
thank you !
Reply
Answers (
1
)
SMS from asp.net 3.5 to mobile??
@OutputCache page directive