Can any one help me to convert a html page and its content to Microsoft Word file .
Basically what i want is a ms word page which looks like my html page in Browser.
i am using this code can any one suggest me something else.
object filename1 = @"html file path";
object oMissing = System.Reflection.Missing.Value;
object readOnly = false;
object oFalse = false;
Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document oDoc = new Microsoft.Office.Interop.Word.Document();
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
oWord.Visible = false;
oDoc = oWord.Documents.Open(ref filename1, ref oMissing, ref readOnly, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
if (!Directory.Exists(@"D:\FileConverter\Temp\new.doc"))//path of destination file.
{
Directory.CreateDirectory(@"D:\FileConverter\Temp");
}
if (!File.Exists(@"D:\FileConverter\Temp\new.doc"))
{
File.Create(@"D:\FileConverter\Temp\new.doc");
}
filename1 = @"D:\FileConverter\Temp\new.doc";
object fileFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument;
oDoc.SaveAs(ref filename1, ref fileFormat, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
oDoc.Close(ref oFalse, ref oMissing, ref oMissing);
oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
here is the Code which any one can use to convert the html page and get the Images also..
TO get the .dll files ..use Link You can download notesfor.dll from here.
It may be the name HTMLtoOpenXML.