Free Support Forum - aspose.com

Re Add Page

This seems like it could be the solution to my problem, but I cannot get it to work in vb.net. Can anyone help please.

Thanks

Shellie

Look for Aspose.Word.Demos.WinForms.VisualBasic project in Demos.

The code for VB looks like this:

'/

'/ Copies all sections from one document to another.

'/

Private Sub AppendDoc(ByVal dstDoc As Document, ByVal srcDoc As Document)

Dim i As Integer

For i = 0 To srcDoc.Sections.Count - 1

'First need to import the section into the destination document,

'this translates any document specific lists or styles.

Dim section As section = CType(dstDoc.ImportNode(srcDoc.Sections(i), True), section)

dstDoc.Sections.Add(section)

Next

End Sub

Thank you so much for this - I am nearly there. Sorry to ask so many questions, but I cannot get the demos to open on my pc, I have to get this website live today and have been up working on it most of the night so my brain is addled!!! Hopefully this is the last question and will be reasonably easy to answer - What you suggested worked, but is there any way to get rid of the blank first page? Also is there any way to programatically put page breaks in before appending the second document.

Once again, many thanks for all your help.

Shellie