My assembly process takes a dynamic list of documents, and appends each into a single document.
The list of documents contain documents with language, and blank documents with formatting only. Formatting documents in the list dictate the format of the each document following after it.
List of documents:
COVER.DOC
TOC.DOC
SPOILER-ALERT.DOC
Format1ColA.DOC (Page Layout : 1 Column, 7.5”, even spaced, no line between)
EXPLANATION.DOC
Format2ColA.DOC (Page Layout : 2 Columns, 3.5”, not even spaced, no line between, 0.5” spacing)
MAIN-CHARACTERS.DOC
SUPPORTING-CHARACTERS.DOC
ENDSECTBREAK.DOC (Page Break)
Format1ColA.DOC (Page Layout : 1 Column, 7.5”, even spaced, no line between)
GLOSSARY.DOC
The issue is that changing from 1 column to 2 columns works fine, but changing from 2 columns to 1 column never works. EXPLANATION is correctly formatting to the 1 column. MAIN-CHARACTERS and SUPPORTING-CHARACTERS are correctly formatting to the 2 columns. However, GLOSSARY is still getting the 2 column format instead of switching to the 1 column format.
Aspose Code:
if (Path.GetFileName((string)m_oFileName).ToUpper().StartsWith("FORMAT"))
{
// go back to end of document
m_oAsposeBuilder.MoveToDocumentEnd();
// insert section break at end of document to get ready for this FORMAT page
Aspose.Words.BreakType BreakType = Aspose.Words.BreakType.SectionBreakContinuous;
m_oAsposeBuilder.InsertBreak(BreakType);
m_oAsposeBuilder.InsertDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
}
else
{
m_oAsposeBuilder.InsertDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
}
AssembledByAspose.DOC has the results of the Document Assembly
Old Word Interop Code:
if (Path.GetFileName((string)m_oFileName).ToUpper().StartsWith("FORMAT"))
{
// go back to end of document
m_oWord.Selection.EndOf(ref oUnit, ref oMovement);
// insert section break at end of document to get ready for this FORMAT page
m_oWord.Selection.InsertBreak(ref BreakType);
m_oWord.Selection.InsertFile(m_oFileName.ToString(), ref m_oOptional, ref tempFalse, ref m_oOptional, ref m_oOptional);
}
else
{
// insert the next page
m_oWord.Selection.InsertFile(m_oFileName.ToString(), ref m_oOptional, ref tempFalse, ref m_oOptional, ref m_oOptional);
}
AssembledByWordInterop.DOC has the results of the Document Assembly
Documents listed and results from both Aspose and Word Interop can be sent in zip file.