(Msg. 1) Posted: Thu Mar 27, 2008 1:17 am
Post subject: Problem of openning doc files on IIS 7 Archived from groups: microsoft>public>word>conversions (more info?)
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.
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum