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.
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>");
str.ToString().Trim();
based on your suggession am used following code too
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();