This project has moved. For the latest updates, please go here.

DocX.Load, system.io.filenotfoundexception

Jan 4, 2013 at 6:34 PM

Hi

When i run this part:

DocX document = DocX.Load(@"C:\SITES\PERFORMA\Performa_lagza\documentRepository\forms\D5A81349-ECC0-4548-B52A-F0021D515594\nueva oferta.doc");

 

it says that the file "could not found", but the file already exist, and to be really sure, i test with File.Copy and the message was that the file already exist.

I try it locally and everything is fine, the problem is in the server.

Note: i'm using a string variable for the path, the last path is from server.

Jan 9, 2013 at 9:03 PM

Verify if you are running this code in other server or PC, and maybe you have to make the folder share

Jan 11, 2013 at 10:49 AM

I think the reason you're getting this error is because you're attempting to open a .doc file. The Docx project will only understand .docx files. These are two very different file types.

.docx files created using Office 2007 and higher are created using XML schemes. The older versions of Office 2003 and lower don't use this file format.

Try again using the correct file format and let us know how you get on.

Jan 14, 2013 at 6:10 PM

The code was ran  in my pc with no problems with .doc files extensions, the problem was when i published in the server.

Jan 14, 2013 at 6:36 PM

The folder was shared and it works :), i'm going to try another installation and see the results, thanks a lot!

Sep 16, 2014 at 3:22 PM
hildajohana wrote:
The folder was shared and it works :), i'm going to try another installation and see the results, thanks a lot!
I have same problem.
Did you share the path \servername\D5A81349-ECC0-4548-B52A-F0021D515594\nueva oferta.doc
and used the code
DocX document = DocX.Load(@" \servername\D5A81349-ECC0-4548-B52A-F0021D515594\nueva oferta.doc");

??

I used same code and get same report "System.IO.FileNotFoundException: File could not be found "

Can you tell me how to fix it?