ASP Classic Doc Sections

I’m adding aspose.words to an old ASP system and need help with adding sections from one document to another. I’ve setup the COM conection and i’m able to open a document and write to it. But now I need to be able to load in additional documents and combine them with others to output one document.

The code in to add doc to outputDoc would be:

Dim sourceSection As Section = doc.Sections(0)
Dim NewSection As Section = CType(outputDoc.ImportNode(sourceSection, True), Section)

What would the equivilent code be to acomplish the same task in ASP class VB?

Thanks for any help


Thanks for your request. Please try using code like the following:

'Create comhelper
Dim comHelper
Set comHelper = CreateObject("Aspose.Words.ComHelper")
'open destination and source documents
Dim dstDoc
Set dstDoc = comHelper.Open(Server.MapPath("dst.doc"))
Dim srcDoc
Set srcDoc = comHelper.Open(Server.MapPath("src.doc"))
'Append source document to destination
Dim dstSection
Dim i
For i = 0 To srcDoc.Sections.Count - 1
    Set dstSection = dstDoc.ImportNode_2(srcDoc.Sections.Item(i), True, 1 )
'Save output document

Hope this helps.
Best regards.