C# OLE Automation: The system cannot find the file specified

Using OLE Automation API
Post Reply
MaverickUK
Posts: 2
Joined: Fri Mar 07, 2008 4:35 am

C# OLE Automation: The system cannot find the file specified

Post by MaverickUK » Fri Mar 07, 2008 4:46 am

I've developed a document system that enables internal members of our organisation to upload documents into a system, which then converts it into a variety of formats and makes them available through our website and kiosk network.

One of the formats the uploaded documents gets converted into is Flash, primarily used by our kiosk network.

However now I've installed the converter system on our server it is failing when trying to a Word document into a Flash document.

An exception is thrown on the following line of code:

Code: Select all

                oConvert.ConvertFile(GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + sFilename,
                                      GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + Path.GetFileNameWithoutExtension(sFilename) + ".SWF",
                                      oProfile, oBatch, oPref );
Which throws the following error:
Converstion of Document41.doc to SWF failed.

System.Runtime.InteropServices.COMException (0x8000FFFF): System Error. Code: 2.
The system cannot find the file specified
at P2F.ServerClass.ConvertFile(String SourceFileName, String OutputFileName, Object Profile, Object BatchProcessingOptions, Object PrintingPreferences)
at AvonAndSomerset.AutoConverter.ConvertPDF2SWF(String sFilename) in C:\Documents and Settings\7877\My Documents\Visual Studio 2008\Projects\DocumentV3_AutoConverter\DocumentV3_AutoConverter\Program.cs:line 269
I've checked the input and output paths are valid, which they appear to be. So I'm unsure of what else could be causing the problem?

Any help would be most
I've developed a document system that enables internal members of our organisation to upload documents into a system, which then converts it into a variety of formats and makes them available through our website and kiosk network.

One of the formats the uploaded documents gets converted into is Flash, primarily used by our kiosk network.

However now I've installed the converter system on our server it is failing when trying to a Word document into a Flash document.

An exception is thrown on the following line of code:

Code: Select all

                oConvert.ConvertFile(GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + sFilename,
                                      GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + Path.GetFileNameWithoutExtension(sFilename) + ".SWF",
                                      oProfile, oBatch, oPref );
Which throws the following error:
Converstion of Document41.doc to SWF failed.

System.Runtime.InteropServices.COMException (0x8000FFFF): System Error. Code: 2.
The system cannot find the file specified
at P2F.ServerClass.ConvertFile(String SourceFileName, String OutputFileName, Object Profile, Object BatchProcessingOptions, Object PrintingPreferences)
at AvonAndSomerset.AutoConverter.ConvertPDF2SWF(String sFilename) in C:\Documents and Settings\7877\My Documents\Visual Studio 2008\Projects\DocumentV3_AutoConverter\DocumentV3_AutoConverter\Program.cs:line 269
I've checked the input and output paths are valid, which they appear to be. So I'm unsure of what else could be causing the problem?

Any help would be most
I've developed a document system that enables internal members of our organisation to upload documents into a system, which then converts it into a variety of formats and makes them available through our website and kiosk network.

One of the formats the uploaded documents gets converted into is Flash, primarly used by our kiosk network.

However now I've installed the converter system on our server it is failing when trying to a Word document into a Flash document.

An exception is thrown on the following line of code:

Code: Select all

                oConvert.ConvertFile(GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + sFilename,
                                      GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + Path.GetFileNameWithoutExtension(sFilename) + ".SWF",
                                      oProfile, oBatch, oPref );
Which throws the following error:
Converstion of Document41.doc to SWF failed.

System.Runtime.InteropServices.COMException (0x8000FFFF): System Error. Code: 2.
The system cannot find the file specified
at P2F.ServerClass.ConvertFile(String SourceFileName, String OutputFileName, Object Profile, Object BatchProcessingOptions, Object PrintingPreferences)
at AvonAndSomerset.AutoConverter.ConvertPDF2SWF(String sFilename) in C:\Documents and Settings\7877\My Documents\Visual Studio 2008\Projects\DocumentV3_AutoConverter\DocumentV3_AutoConverter\Program.cs:line 269
I've checked the input and output paths are valid, which they appear to be. So I'm unsure of what else could be causing the problem?

Any help would be most appresiated

staff
Posts: 282
Joined: Sat Dec 15, 2007 4:48 pm

Re: C# OLE Automation: The system cannot find the file specified

Post by staff » Thu Mar 20, 2008 3:59 pm

This error most certainly means that input file path and name is wrong. Try to write it to the output to see if it is valid. Also you may try to specify a hard-coded file name instead of using your concatenation logic to test it.

MaverickUK
Posts: 2
Joined: Fri Mar 07, 2008 4:35 am

Re: C# OLE Automation: The system cannot find the file specified

Post by MaverickUK » Tue Apr 01, 2008 5:47 am

I've check the inputs and outputs being given, which are correct - as follows:

Code: Select all

Input: C:\PeteTech\DocumentsV3_AutoConverter\Temp\Document42.doc

Output: C:\PeteTech\DocumentsV3_AutoConverter\Temp\Document42.SWF
These are the inputs and output begin specificed on the following line of code:

Code: Select all

                oConvert.ConvertFile(GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + sFilename,
                                      GetStartupPath() + ConfigurationSettings.AppSettings["TempPath"] + Path.GetFileNameWithoutExtension(sFilename) + ".SWF",
                                      oProfile, oBatch, oPref );
If I run "C:\PeteTech\DocumentsV3_AutoConverter\Temp\Document42.doc" from the Windows run command, Word opens up with the document.

In addition if I open the Print2Flash application on the server and choice Open & convert to Flash then select the document, it comes back with the following error:
System Error. Code: 2. The system cannot find the file specified.
Do you have any ideas as to what could be causing this exception? I would appreciate a rapid solution to this issue.

Post Reply