R
rhitam
Hi all ,
I am trying to open an strict xhtml document by using word object and
trying to save as a word document. Below is my code :
public static void CreateWord(String HtmlFile)
{
object filename1 = HtmlFile;
object oMissing = System.Reflection.Missing.Value;
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);
filename1 = @"C:\Testproject\Testproject\bin\Debug
\Report.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);
}
while executing above code , i get a warning like this :
"Linked style sheets are supported only in web format files. By
saving to this format , all links to style sheets would be lost"
How can i avoid such warnings through the program ? Also after i click
"continue" , a blank word document opens , even though i have
oWord.Visible =
false;
in my code
Any ideas ?
I am trying to open an strict xhtml document by using word object and
trying to save as a word document. Below is my code :
public static void CreateWord(String HtmlFile)
{
object filename1 = HtmlFile;
object oMissing = System.Reflection.Missing.Value;
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);
filename1 = @"C:\Testproject\Testproject\bin\Debug
\Report.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);
}
while executing above code , i get a warning like this :
"Linked style sheets are supported only in web format files. By
saving to this format , all links to style sheets would be lost"
How can i avoid such warnings through the program ? Also after i click
"continue" , a blank word document opens , even though i have
oWord.Visible =
false;
in my code
Any ideas ?