在服务器的asp.net中显示的Word文档 [英] word document showing in asp.net in server
本文介绍了在服务器的asp.net中显示的Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,先生,
我想将简历显示到带有突出显示选项的文本框中.
我在本地很好地完成了此任务,但未在服务器上显示.
我们已经使用了sqlserver2000和sqlserver2005数据库,c#和asp.net3.5版本
请告诉我在服务器上运行的解决方案
我已使用此代码
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
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);
它仅在本地运行,
谢谢
S Nandakumar
it is running only locally,
Thanks
S Nandakumar
推荐答案
服务器上是否存在MS Word PIA?
另外-文档可能会请求保存权限(通过显示对话框),并且由于应用程序运行文档的方式,它可能不可见.
因此,请查看您的对象方法,以了解哪些参数可以抑制对话框.在服务器上创建和保存文档时,过去我们在Excel中也遇到过类似的问题.
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.
这篇关于在服务器的asp.net中显示的Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文