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

i want show the resume into textbox with highlighting option.

i done this task locally well, but it is not showing on the server .

we have using Sqlserver2000 and sqlserver2005 database, c# and asp.net3.5 version

please tell me solution to run on the server


i have used this code

C#
msWord.ApplicationClass oWord = new msWord.ApplicationClass();
                           object nullobj = System.Reflection.Missing.Value;
                           string location = Server.MapPath("~") + "\\Resumes\\";
                           object file = location.Trim() + resume.Trim(); //"D:/Folder1/1.doc"; //location; // @"D:\DOT NET\sanvelsinfo\Resumes\SVCM-00002.doc";
                           Word.Document oWordDoc = (Word.Document)(oWord.Documents.Add(ref file, ref nullobj, ref nullobj, ref nullobj));
                           str = oWordDoc.Content.Text;
                           if (str.ToLower().Contains(keyword) || str.ToUpper().Contains(keyword))
                           {
                               filename = resume.Trim();
                               filename = filename.Replace(".doc", "");
                               filename = filename + ",";
                               lbl_resume.Text = str.ToString();
                               uid = lbl_uid.Text;
                               Total_file += filename.ToString();
                           }
                           oWord.Quit(ref nullobj, ref nullobj, ref nullobj);


it is running only locally,




Thanks

S Nandakumar
Posted
Updated 5-May-12 1:02am
v3
Comments
hitech_s 5-May-12 5:51am    
can you share part of code ?
Nandakumar31 5-May-12 6:09am    
hi sir

i have used this code

msWord.ApplicationClass oWord = new msWord.ApplicationClass();
object nullobj = System.Reflection.Missing.Value;
string location = Server.MapPath("~") + "\\Resumes\\";
object file = location.Trim() + resume.Trim(); //"D:/Folder1/1.doc"; //location; // @"D:\DOT NET\sanvelsinfo\Resumes\SVCM-00002.doc";
Word.Document oWordDoc = (Word.Document)(oWord.Documents.Add(ref file, ref nullobj, ref nullobj, ref nullobj));
str = oWordDoc.Content.Text;
if (str.ToLower().Contains(keyword) || str.ToUpper().Contains(keyword))
{
filename = resume.Trim();
filename = filename.Replace(".doc", "");
filename = filename + ",";
lbl_resume.Text = str.ToString();
uid = lbl_uid.Text;
Total_file += filename.ToString();
}
oWord.Quit(ref nullobj, ref nullobj, ref nullobj);

it is running only locally,

1 solution

Is the MS Word PIA on the server?

Also - the document might request permission to save (by displaying a dialogue box) and because of the way the application is running the document, it might not be visible.

So have a look at the your object methods to see what parameter can suppress dialogue boxes. We have had a similar problem with Excel in the past when creating and saving the document on the server.
 
Share this answer
 

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