Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi sir,

am used following code to fetch the resume from msword application then show into text box in local iis.

then deployed application into dll.

then uploaded the server using filezilla

but the application doesn't read the document and not showing the at server

please give me the solution.

C#
msWord.ApplicationClass oWord = new msWord.ApplicationClass();
            object nullobj = System.Reflection.Missing.Value;
            string location = Server.MapPath("~") + "\\Resumes\\" + "SVCM-00002.doc";
            object file = location;
            Word.Document oWordDoc = (Word.Document)(oWord.Documents.Add(ref file, ref nullobj, ref nullobj, ref nullobj));
            string str = oWordDoc.Content.Text;
            str.Replace("\n", "<br>");
            str.Replace("\r", "<br>");
            //txtresume.Text = "";
            str.ToString().Trim();

based on your suggession am used following code too

C#
using(System.IO. StreamReader sr=new System.IO. StreamReader())
{
 textbox.text=sr.ReadToEnd();
}

This showing unwanted objects before text and after text



am tried ur code also but not progress

this also suitable only locally , not support in server

please give me a proper solutions


msWord.ApplicationClass wordApp = new msWord.ApplicationClass();
//object nullobj = System.Reflection.Missing.Value;
string location = Server.MapPath("~") + "\\Resumes\\" + "SVCM-00002.doc";
object file = location;
object nullobj = System.Reflection.Missing.Value;
Word.Document doc = (Word.Document)(wordApp.Documents.Add(ref file, ref nullobj, ref nullobj, ref nullobj));
string ss = doc.Content.Text;
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
//IDataObject data = Clipboard.GetDataObject();
//TextBox1.Text = data.GetData(DataFormats.Text).ToString();
TextBox1.Text = doc.ToString();
Posted
Updated 8-May-12 0:44am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900