本帖最后由 feiwufengsha1234 于 2012-03-10 13:27:40 编辑

解决方案 »

  1.   

    http://ufo-crackerx.blog.163.com/blog/static/11307877820111017113958413/是很好的,,,能可視化合併,以及插入圖片
      

  2.   

    谢谢楼上的,可能我问题没说清楚。我是通过在Word中添加域来标记某个字段,然后添加内容的。表格是通过 «TableStart:Rows»«TableEnd:Rows»来调用数据库中的行的。表格已经能够完成了,但是对于合并某列中相同的单元格还是一筹莫展啊,很急的东西,找了那么多天,没办法了都!
      

  3.   

    算了,又换了另一种方法。似乎Aspose.Words关于合并方面的东西真的很少啊,不会不能合并吧,唉
      

  4.   

    你可以参考这段代码:try
    {
    Aspose.Words.Document doc = new Aspose.Words.Document(templateFile);
    Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);builder.InsertCell();
    builder.CellFormat.Borders.LineStyle = LineStyle.Single;
    builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
    builder.CellFormat.VerticalMerge = CellMerge.First;
    builder.Write("Text in merged cells.");builder.InsertCell();
    builder.CellFormat.Borders.LineStyle = LineStyle.Single;
    builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
    builder.CellFormat.VerticalMerge = CellMerge.None;
    builder.Write("Text in one cell");
    builder.EndRow();builder.InsertCell();
    builder.CellFormat.Borders.LineStyle = LineStyle.Single;
    builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
    // This cell is vertically merged to the cell above and should be empty.
    builder.CellFormat.VerticalMerge = CellMerge.Previous;builder.InsertCell();
    builder.CellFormat.Borders.LineStyle = LineStyle.Single;
    builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
    builder.CellFormat.VerticalMerge = CellMerge.None;
    builder.Write("Text in another cell");
    builder.EndRow();doc.Save(saveDocFile);
    if (MessageUtil.ShowYesNoAndTips("保存成功,是否打开文件?") == System.Windows.Forms.DialogResult.Yes)
    {
    System.Diagnostics.Process.Start(saveDocFile);
    }
    }
    catch (Exception ex)
    {
    LogHelper.Error(ex);
    MessageUtil.ShowError(ex.Message);
    return;
    }有不明白之处,你可以参考原文:http://www.evget.com/zh-CN/Info/catalog/17766.html