Is there any way I can create doc file using C#. I have tried it but it does not open in 2003 but it opens in word 2007?
I have been using this code but the doc file does not open in word 2003:
//writing to doc file
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word._Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word._Document oDoc = new Microsoft.Office.Interop.Word.Document();
oWord.Visible = false;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
//Insert a paragraph at the beginning of the document.
Microsoft.Office.Interop.Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara1.Range.Text = text;
object fileName = "C:\\question.doc";
oDoc.SaveAs(ref fileName,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing,
ref oMissing, ref oMissing);