Problem of openning doc files on IIS 7



Hi,
I have a Web Application with this C# code hosted in IIS 7 (Vista).
I have Word 2007 on the server. My target is to save files as RTF.
--------------------------------------------------------------------------------
// Save As RTF
//
object True=true, False=false, Missing = System.Reflection.Missing.Value;
ApplicationClass app = new ApplicationClass();
object inFormat = WdOpenFormat.wdOpenFormatAuto;
//
// The following line fails to open the file and "doc" is always null
//
Document doc = app.Documents.OpenOld(ref inFile,ref False,
ref True,ref False,ref Missing,ref Missing,ref Missing,
ref Missing,ref Missing,ref inFormat);
//
// The rest of code is to save as RTF and close word
//
object saveFormat = WdSaveFormat.wdFormatRTF;
doc.SaveAs2000(ref outFile,ref saveFormat,ref Missing,ref Missing,
ref Missing,ref Missing,ref Missing,
ref Missing,ref Missing,ref Missing,ref Missing);
doc.Close(ref Missing,ref Missing,ref Missing);
app.Quit(ref Missing,ref Missing,ref Missing);
--------------------------------------------------------------------------------
This code fails to open files and msword.exe fails to close correctly.
Open() or OpenOld() returns null with no exceptions in IIS 7 (Vista), but
works fine in Desktop Applications or in IIS 6 (Win 2003).
I tried similar code in C++ and it also fails.
I tried also to put this code in a seperate exe and call it like this:
RTFConv.exe <inFile> <outFile>, but it also fails.

I want a solution for this problem or maybe another way for converting DOC
files to RTF from server side code on IIS 7.

Thanks,
Eslam Kamal
.



Relevant Pages

  • Re: Error Code 403
    ... Open IIS ... If missing, add default.aspx ... Merv Porter [SBS-MVP] ...
    (microsoft.public.windows.server.sbs)
  • Re: problem when executing asp in IIS 5.0
    ... You can probably get your site temporarily operational by using the IIS ... and let run both straight forward ASP and those ... Out-of-process" component is missing and I can't re-install it using the MS ... > and i test that i can run the html file ...
    (microsoft.public.inetserver.iis)
  • RE: ASP.NET Membership
    ... I suspect this problem is related to the X64 platform you used. ... similar issue reported on X64 and the cause is due to missing ASP.NET ... ASP.NET after the IIS metabase setting Enable32bitAppOnWin64 had already ... What this does is switch IIS to 64-bit mode, run the installation of 64-bit ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: IIS Log / Custom Error database discrepancies
    ... "fatal" errors that stop the IIS engine's processing. ... >> that don't have any matching records in our site error log database. ... > different errors in your log (that weren't caught by the error handler) ... Pre-processor items might do this (e.g. missing ...
    (microsoft.public.inetserver.asp.general)
  • How to Authenticate a User Against All Trusted Domains (IIS 6.0, Exchange 2003)
    ... I have seen instructions for IIS changes to allow OWA ... users to login using credentials only (ref. ... changed to "\" restarted IIS, ...
    (microsoft.public.exchange.setup)