Free Support Forum -

Copy multiple column document to another document


I'm trying to copy a multiple column document into another document, but end up with a document with only one column. I must be doing something seriously wrong here.

Here's the code:

while (oldDoc.Sections.Count > 0)


Section section = oldDoc.Sections[0];

Section newSection = (Section)_document.ImportNode(section, true);



_document.Sections[_document.Sections.Count - 1].PageSetup.TextColumns.SetCount(2);

_document.Sections[_document.Sections.Count - 1].PageSetup.TextColumns.EvenlySpaced = true;



Thanks for your inquiry. I tried to use the following code for testing and all works fine on my side.

//Open destination document

Document dstDoc = new Document(@"Test009\in1.doc");

//Open source document

Document srcDoc = new Document(@"Test009\in2.doc");

foreach (Section srcSection in srcDoc.Sections)


//Import section

Section newSection = (Section)dstDoc.ImportNode(srcSection, true);

//Insert section



//Save output document


Please attach your documents for testing.

Best regards.


Your loop worked.

Maybe it's got something to do with me removing the sections from the old doc in my while loop.