Hi,
Using your code, i can get the data to merge to columns , which is great...
But now the issue is that when i insert this document into another document, it displays as only 1 column ?
I am using the following code to insert the merged 2 columns document into another document...
Private Sub InsertDocument(ByVal insertAfterNode As Node, ByVal srcDoc As Document)
' We need to make sure that the specified node is either paragraph or table.
If Not ((insertAfterNode.NodeType = NodeType.Paragraph) OrElse (insertAfterNode.NodeType = NodeType.Table)) Then
Throw New ArgumentException("The destination node should be either paragraph or table.")
End If
' We will be inserting into the parent of the destination paragraph.
Dim dstStory As CompositeNode = insertAfterNode.ParentNode
' This object will be translating styles and lists during the import.
Dim importer As NodeImporter = New NodeImporter(srcDoc, insertAfterNode.Document, ImportFormatMode.KeepSourceFormatting)
' Loop through all sections in the source document.
For Each srcSection As Aspose.Words.Section In srcDoc.Sections
' Loop through all block level nodes (paragraphs and tables) in the body of the section.
For Each srcNode As Node In srcSection.Body
' Do not insert node if it is a last empty paragarph in the section.
Dim para As Aspose.Words.Paragraph = TryCast(srcNode, Aspose.Words.Paragraph)
If (Not para Is Nothing) AndAlso para.IsEndOfSection AndAlso (Not para.HasChildNodes) Then
Exit For
End If
' This creates a clone of the node, suitable for insertion into the destination document.
Dim newNode As Node = importer.ImportNode(srcNode, True)
' Insert new node after the reference node.
dstStory.InsertAfter(newNode, insertAfterNode)
insertAfterNode = newNode
Next srcNode
Next srcSection
End Sub
Thanks
Mark