日期:2014-05-17  浏览次数:20454 次

asp.net 多线程 Word下载打印
每次运行到 Microsoft.Office.Interop.Word.Application thisApplication = new Microsoft.Office.Interop.Word.ApplicationClass();时总会报错80070005错误,上网搜索说是Word权限设置问题,可是之前没有用线程时已经添加过 <identity impersonate="true" userName="Administrator" password="1"/>,Word权限方面也设置过了,请问大侠们有没有关于多线程操作Word的实例啊,最好是能运行的,急求!


------解决方案--------------------
没有遇到过呢...进来学习一下...顶帖子。
------解决方案--------------------
你在服务器上打印文件?
------解决方案--------------------
你是用什么方式进行的下载。 。 。 
如果是用流的方式下载的话。 可能是下载的时候这个文件被锁住了。 然后在打印的时候报错。
------解决方案--------------------
参照这个

Thread myThread = new Thread( new ThreadStart(openWord));
 SetUIVisible(false);
 myThread.IsBackground = true;
 myThread.Start();

 void openWord()
{

this.webBrowserWord.Navigate(filePath);
this.Invoke(new delegateSetLblVisibal(SetUIVisible), new object[] { true });
}
void SetUIVisible(bool visible)
{
this.lblOpening.Text="正在打开。。。";
this.lblOpening.Visible = !visible;
}
------解决方案--------------------
Thread myThread = new Thread( new ThreadStart(openWord));
 SetUIVisible(false);
 myThread.IsBackground = true;
 myThread.Start();

 void openWord()
{

this.webBrowserWord.Navigate(filePath);
this.Invoke(new delegateSetLblVisibal(SetUIVisible), new object[] { true });
}
void SetUIVisible(bool visible)
{
this.lblOpening.Text="正在打开。。。";
this.lblOpening.Visible = !visible;
}