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
venkatesh natukula
NA
5
7.7k
Images are not processing in word to html conversion
Jan 30 2014 4:43 AM
Hi,
i am using "Microsoft.Office.Interop.Word" to convert .doc files to html. but these are not processing images . please help me.. this is my code
filename = Server.MapPath("ServicesDoc.docx");
Microsoft.Office.Interop.Word.ApplicationClass AC = new Microsoft.Office.Interop.Word.ApplicationClass();
//Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
object documentFormat = 10;
string randomName = DateTime.Now.Ticks.ToString();
object htmlFilePath = Server.MapPath("~/Temp/") + randomName + ".html";
try
{
//Open the word document in background
ApplicationClass applicationclass = new ApplicationClass();
applicationclass.Documents.Open(ref filename);
applicationclass.Visible = false;
Document doc = applicationclass.ActiveDocument;
//doc = AC.Documents.Open(ref filename);
//Save the word document as HTML file
doc.SaveAs2(ref htmlFilePath, ref documentFormat);
doc.Close(ref missing, ref missing, ref missing);
byte[] bytes;
using (FileStream fs = new FileStream(htmlFilePath.ToString(), FileMode.Open, FileAccess.Read))
{
BinaryReader reader = new BinaryReader(fs);
bytes = reader.ReadBytes((int)fs.Length);
fs.Close();
}
Response.BinaryWrite(bytes);
Response.Flush();
Reply
Answers (
2
)
IMP ISSUE TO SHARE
DropDownList selected value in controller in MVC3