Hi,
In my Application I am opening the Document file and Converting that file to a HTML file. Its working fine but the values in the Session is lost when this action is performed can u please help me to solve this issue. I have not given any Response. Redirect method. I am just binding the Grid when the action is action is performed successfully. Here is my code.
public void Upload()
{
object missingType = Type.Missing;
object readOnly = true;
object isVisible = false;
object documentFormat = 8;
object htmlFilePath = Server.MapPath("~/HelpFolder/HTML Files/") + hdFileName.Value + ".htm";
object fileName = Server.MapPath("~/HelpFolder/Doc Files/")+hdFileName.Value+ ".Docx";
Microsoft.Office.Interop.Word.ApplicationClass applicationclass = new Microsoft.Office.Interop.Word.ApplicationClass();
applicationclass.Documents.Open(ref fileName,
ref readOnly,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref isVisible,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType);
applicationclass.Visible = false;
Microsoft.Office.Interop.Word.Document document = applicationclass.ActiveDocument;
document.SaveAs(ref htmlFilePath, ref documentFormat, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType);
((Microsoft.Office.Interop.Word._Document)document).Close(ref missingType, ref missingType, ref missingType);
((Microsoft.Office.Interop.Word._Application)applicationclass).Quit(ref missingType, ref missingType, ref missingType);
}
Thanks