Hi all,
I'm trying to open a word document using:
Note: Replace $$$$$ in the code window with all these
"Document\Test1.doc";
"Document\\Test1.doc";
"@"
And the result is always the same, I get the message:
System.Runtime.InteropServices.COMException: The document name or path is not valid. Try one or more of the following: * Check the path to make sure it was typed correctly. * On the File menu, click Open. Search for the file using this dialog box. (
I'm using visual studio 2003 with c#. The file is definetly in the directory, the folder is added to the project, and I have NO idea why it will not find it.
Anyone has gone through this?
Thanks
Luis Torres
I'm trying to open a word document using:
Note: Replace $$$$$ in the code window with all these
"Document\Test1.doc";
"Document\\Test1.doc";
"@"
Code:
Word.Application WordApplication = new Word.Application ();
object FileName = $$$$$
object ReadOnly = true;
object IsVisible = true;
object MissingValue = Type.Missing;
Word.Document WordDocument = WordApplication.Documents.Open (ref FileName, ref MissingValue,
ref ReadOnly, ref MissingValue, ref MissingValue, ref MissingValue,
ref MissingValue, ref MissingValue, ref MissingValue, ref MissingValue,
ref MissingValue, ref IsVisible, ref MissingValue, ref MissingValue,
ref MissingValue, ref MissingValue);
WordApplication.Visible = true;
And the result is always the same, I get the message:
System.Runtime.InteropServices.COMException: The document name or path is not valid. Try one or more of the following: * Check the path to make sure it was typed correctly. * On the File menu, click Open. Search for the file using this dialog box. (
I'm using visual studio 2003 with c#. The file is definetly in the directory, the folder is added to the project, and I have NO idea why it will not find it.
Anyone has gone through this?
Thanks
Luis Torres