日期:2014-05-20  浏览次数:21094 次

这个是怎么回事。。。怎么盘符都出来了。。
[NullReferenceException: 未将对象引用设置到对象的实例。]
  HuanJiSystem.WordHandle.WordClass.OpenDoc(String DocName) in F:\Item\HuanJiSystem\WordHandle\WordClass.cs:80
  HuanJiSystem.WordHandle.WordClass.EditTable(String[,] TableInfo, String DocName, Int32 RangeNum, String DocPath, String str, String[] FileAndImage) in F:\Item\HuanJiSystem\WordHandle\WordClass.cs:88
  HuanJiSystem.DetectionInfo.SC_Input.Button_SC_Click(Object sender, EventArgs e) in F:\Item\HuanJiSystem\HuanJiSystem\DetectionInfo\SC_Input.aspx.cs:188
  System.Web.UI.WebControls.Button.OnClick(EventArgs e) +114
  System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +139
  System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +28
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2980
 


这。。盘符都跑出来。是为啥呢。。。WordClass 是在类库里。初始化没有问题,到了 

WordDoc = WordApp.Documents.Open(DocName, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing, ref o_Missing);
行 79: WordApp.Visible = true;
行 80: WordRange = WordDoc.Range();

Range()这里的时候,地址的错误都出来了。。。

这是在IIS里。。。C盘下。。




------解决方案--------------------
那是调试符号,是你源代码的位置,是给你调试自己的源代码用的。跟它最终部署在c:驱动器没有关系。
------解决方案--------------------
DocName有问题吧
应该没Open成功