Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Mon Jan 17, 2011 3:50 am

Hello,
Once I wanted to merge multiple documents into one. And after it I wanted to get the sequence of the Word documentas merge.
How can I do it with Spire.DOC?
Thanks!

james
 
Posts: 8
Joined: Tue Dec 21, 2010 9:29 am

Tue Jan 18, 2011 2:47 am

You may use section.Clone method. You may clone the documents which will be merged, and then add them into the document.
Code:
Document documentMerge = new Document();
documentMerge.LoadFromFile(fileMerge, FileFormat.Doc);

foreach( Section sec in documentMerge.Sections)
{
document.Sections.Add(sec.Clone());
}
The order will be ordinal.
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.Doc