I've an ASP.NET page to convert local .doc file to pdf using Word 2007. The code runs fine running within VS.NET. It was giving COM error 80070005 running using IIS instead VS.NET but I managed to fix it using DCOMCNFG and adding ASPNET user to it. The problem is the code comes to a stop while opening the .doc file. It doesn't give any exceptions, it doesn't seem to timeout, it just waits there. Can you give me any ideas what's wrong? The code stops at this .Open() line :
ApplicationClass app = new ApplicationClass();
object missing = System.Reflection.Missing.Value;
object file = @"c:\test\test.doc";
object f = false;
object t = true;
doc = app.Documents.Open(ref file, ref missing, ref f, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref f, ref missing, ref missing, ref missing, ref missing);object FileName = @"c:\test\word2pdf.pdf";
object FileFormat = WdSaveFormat.wdFormatPDF;
object Encoding = MsoEncoding.msoEncodingEBCDICEnglish;
object LineEnding = WdLineEndingType.wdCRLF;
doc.SaveAs(ref FileName, ref FileFormat, ref f, ref missing, ref f, ref missing, ref f, ref f, ref t, ref t, ref f, ref Encoding, ref f, ref f, ref LineEnding, ref f);
Label1.Text = "ok.";
object nosave = WdSaveOptions.wdDoNotSaveChanges;
doc.Close(ref nosave, ref missing, ref missing);
app.Quit(ref nosave, ref missing, ref missing);