日期:2014-05-18  浏览次数:20829 次

asp.net Word 操作
我用 private ApplicationClass WordApp;

  在里面动态增加行 代码如下:
  public void addrow(string LabelId)
  {
  object bkmC = LabelId;//word中的书签名
  object Missing =Type.Missing;
  if (WordApp.ActiveDocument.Bookmarks.Exists(LabelId) == true)
  {
  WordApp.ActiveDocument.Bookmarks.get_Item(ref bkmC).Select();
  WordApp.ActiveDocument.Bookmarks.get_Item(ref bkmC).Application.ActiveDocument.Tables[1].Rows.Add(ref Missing);
  }
   
  }

用这个代码现在可以增加行了,但是增加的地方不是我想要的,现在我想要的是 在书签LabelId 下面添加行!求各位大侠 !

------解决方案--------------------
用它
http://www.ocxt.com/