File name losing path.
-
Hey all, I am having a major problem trying to pull up a word file that has been selected by the user using an HTML file input box (open file dialog box). If I run it from my computer, the whole path is there when it tries to find the file selected. If I run it on the webserver, it loses the path of the document. Here is my code: protected void openWord() { string pathname = File1.Value.ToString(); //HTML File Input Control //set path of word doc you are opening object fileName = pathname; object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; //make word document appear WordObj.Visible = true; //open specified word document Microsoft.Office.Interop.Word.Document wordDoc = WordObj.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); When I run this on my machine, its fine, the webserver has word installed on it. Please help! Thank you in advance! Dave
-
Hey all, I am having a major problem trying to pull up a word file that has been selected by the user using an HTML file input box (open file dialog box). If I run it from my computer, the whole path is there when it tries to find the file selected. If I run it on the webserver, it loses the path of the document. Here is my code: protected void openWord() { string pathname = File1.Value.ToString(); //HTML File Input Control //set path of word doc you are opening object fileName = pathname; object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; //make word document appear WordObj.Visible = true; //open specified word document Microsoft.Office.Interop.Word.Document wordDoc = WordObj.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); When I run this on my machine, its fine, the webserver has word installed on it. Please help! Thank you in advance! Dave