C#:
private bool OpenWord()
{
try
{
wordApp = new ApplicationClass();
tname = (object) templateFileName;
wordApp.Visible = false;
//wordDoc = wordApp.Documents.Open(ref tname, ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing); //for Word 2000
wordDoc = wordApp.Documents.Open(ref tname, 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,ref oMissing); //for Word 2003
return true;
}
catch (Exception ex)
{
myLogFile.WriteLine("Error while attempting to open the template." + ex.Message + ex.StackTrace );
cleanUp();
wordApp = null;
return false;
}
}
Please help me....
Thanks,
Subhosh.
Last edited by a moderator: