Thought I was on to something with the last post about multiple ope/saves, but it turns out it was just part of my problem.
I re-worked the code to read the list of documents that need to be assembled from a database, then do the assembly all at once and save the assembled file (code below). The coding works fine, and produces a document with all the sections in the right place that can be opened by Word 2003. However, if you re-save (SaveAs) or try to modify or print the document, Word crashes.
In an effort to determine if it was one of my 27 source files that was causing the problem, I limited the assembly process to a few documents at a time, but in each case, the crashes occurred. So, either all of my source documents are "corrupt," or I am doing something wrong.
I did notice a peculiar thing... when attempting to make a master file ("Report.doc") from the five smaller files I will send you by email, the Aspose-created Report.doc was 20kB -- smaller than the blank sourcefile ("Report.doc") from which it was created. When I open the assembled file in Word, it manages to write 39k before it crashes -- to illustrate:
Original: Report.doc -- 23kb (blank Word 2003 document)
Addfile1: locmap.doc -- 24kb (one page Word 2003 document)
Addfile2: sitedescription.doc -- 40kb (one page Word 2003 document)
Addfile3: improvementdescription.doc -- 26kb (one page Word 2003 document)
Addfile4: platmap1.doc -- 24kb (one page Word 2003 document)
Addfile5: sketch1.doc -- 24kb (one page Word 2003 document)
Result: Report.doc -- 20kb (five page Word 2003 document)
Open Report.doc in Word 2003 (OK)
Print Report.doc in Word 2003 (Crash)
SaveAs Report.doc > Test.doc (writes Test.doc -- 39kb five pages)
Test.doc can then be opened, but alos crashes on print or save.
I will email you the blank, the five addfiles, and the results...
(code snippet follows)
Document destDoc = word.Open("c:...\\"+Request.Params["fileno"]+destName);
DataTable myTable = ExecuteDataTable("doclist","SELECT * FROM doclist");
for (int i = 0; i < myTable.Rows.Count; i++)
DataRow row = myTable.Rows[ i ];
string srcnm = Convert.ToString(row["docname"]);
Document srcDoc = word.Open("c:...\\masterdocs\\"+srcnm);
while (srcDoc.Sections.Count > 0)
Section section = srcDoc.Sections;