Discussion Locked

MS Word reports "document is becoming to

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hi,
I have a MSWord template that is triggered in background (by a C++ app) and creates a docmuent based on input it reads from an XML file.
After some minutes I get the error message "The document is becoming too complex. Please full save the document now." from Word. Which is of course a problem since Word runs in background.
Any ideas on how to solve this ?

6 replies

by steven.green

When Word comes up with this error, it is primarily to do with RAM. I have had this message quite regularly with large complex documents (usually with lots of tables or forms) even on my 128MB RAM Compaq P500. It occurs all the time with such documents on less able machines.

The error is definately Word based, and the only solution I have found, apart from adding more RAM, is to make sure you save the document regularly.

It may be an idea to insert some more code into your C++ application, perhaps something that saves the document halfway through it's building of the form and then conitnues. The problem resides with Word's undo function. It has trouble saving all the actions it needs to undo and that is why you get the error message. If you save and close the document and then re-open it it starts to work fine again, so perhaps the document could be saved into temp, re-opened and the rest of the process continues.

Hope this provides some pointers

by guy.vertommen

I tried adding intermediate saves to the process, and it helps: no more error messages. BUT there is of course a contra: now the process of generating a document is a lot slower than before.

In the meantime, I found on MSDN a hint that told me to avoid the use of Styles a lot, more specificly, Styles that are defined atop of each other.

I will be implementing both of these solutions, and find a balance between intermediate saves, processing time, and the use of Styles.

thank you all.

by marcusm

The best solution is to split the document into smaller 'chapters' - that way (even if you can get around the problem) you can be reasonably sure that it will open on a loewr spec system.

by guy.vertommen

I can't, the final document is supposed to be sent to a customer, and I don't have an additional step to re-unite the doc parts.

by kevin holden

Both of the above answers are on track. However, as for the chapters, if you are using 2000, then I might suggest that you create a master document and subdocuments. Then adjust you C++ code to open each subdocument separtely, complete the actions for that section, save and close the section, then repeat for each subsequent section. To print of use the entire document, just just the master document.

by guy.vertommen

For the same reason: I need to generate a single, clean Word doc that must be delivered to my customer.

This discussion is closed to new replies.