当前位置:编程学习 > C#/ASP.NET >>

使用文档处理控件Aspose.Words文档合并实现方法

使用Aspose.Words实现文档合并是非常简单的,Aspose.Words提供了一个特殊的Document.AppendDocument方法实现这个目的,并用于连接两个文档。

这个方法将所需文档部分从源文档复制到目标文档。这就消除了任何在自动化中所需要的分节符插入。
<span face="">
Document doc = new Document();
doc.RemoveAllChildren(); 
int recordCount = 5;
for (int i = 1; i <= recordCount; i++)
{
    Document srcDoc = new Document(@"C:\DetailsList.doc"); 
    doc.AppendDocument(srcDoc, ImportFormatMode.UseDestinationStyles); 
  Aspose.Words we
    already. 
   this section    .
    if (i > 1)
        doc.Sections[i].HeadersFooters.LinkToPrevious(false);
}<strong>  
</strong></span>
文档处理控件 Aspose.Words 文字处理控件 --------------------编程问答--------------------
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,