Microsoft Word Development - Crisis

A

avarghese

Hi,

I have an application that pulls data from the database and displays them in Word documents. How it works is:

1) An client-server interface allows the user to choose whether to start a new document or open an existing one.
2) The client server interface opens Microsoft Word and attaches a template to it. From here on Word takes over and the
client-server application is no more relevant. All user-interface capabilities are implemented in Word using VBA. The
version of Word we use is Word 2000.
3) A VBA screen with a list of sections pops up and asks the user to select the record and the sections that need to be
displayed for that record. User selects and presses "Finish".
4) Word pulls data related to the selected record and relevent to the sections selected by the user and formats them into
paragraphs/tables and puts them in a word document. Word also paginates and indexes the document. Document size
could range from just 50 pages to 800 pages depending on user selection. Word pulls this data from a web-server by
invoking the url which returns an XML document along with data and some minimal formatting back to Word.
5) Once the document is displayed the user may re-paginate/re-index or refresh different sections or all sections of the
document.
6) User may also archive a document and next year work with the same document to refresh what has changed in a
years time.

However, I found that whenever the document is more than 500 pages in size, Word crashes if the user tries to paginate/re-index or if the user simply navigates down the pages in the document. I think this could be because of the size of the document. Looks like Word cannot handle exceptionally large documents. I'm not sure.

This is where I need some advice. I planned to try and split up this document based on user inputs. Along with selecting sections to put into the document, the user will also be asked to choose which sections should be within the document and which ones should be appendages. The the document generation utility should generate different documents with reference links to those appendages. However, when the user prints the main document, it should print the other documents seamlessly as if it is one document. That is one solution.

Another solution is to move the forms (screens) out of the VBA template file (there are currently 11 screens for various requirements) onto my client-server application and leave only the document generation code within the template. It could be possible that Word cannot handle such a large template file as an attachment. The size of the template file is 685 KB.

I need some kind of advice or help. I need to know whether I am on the right track. Is it true that Word cannot handle large template files as attachments? Is it true that Word cannot handle documents that are bigger than 500 pages? If so, what is the best solution to this problem? The clients are not too happy with upgrading their machines to higher configurations. They currently have Pentium III with Windows 2000 installed, about 4GB HDD and 125MB-256MB RAM. So thats not really bad configs. So, whatever enhancements/improvements have to be handled within my application. I'd really appreciate any help.

Thank you,
Alex
 
J

Jim Gordon MVP

Hi

Since this is the Macintosh Word newsgroup my comments apply to Macintosh
versions of Word.

Word can handle large documents. 500 pages is not unusually large.

You haven't given us many specifics, so it's hard to say what's going on. An
easy troubleshooting step is to remove the final paragraph mark. If you do
that, does it correct the problem?
 
J

John McGhie [MVP - Word]

Alex:

Word's limits are:

32 MB of text characters, or 2GB in a single file. 32 MB of text characters
equates to roughly 5,500 pages in a single file. These are "official,
published" limits. I can tell you that Word will work a little further
north than five thousand pages if you are running Windows XP and NTFS file
system with plenty of memory. However, it will get very slow north of 5,000
pages.

Your problem is likely to be that you are performing editing with VBA and
not Saving between operations. When you edit in Word, it stacks your
changes into an UNDO buffer in case you want to back them out.

Word then loads up the changes in memory until it runs out, then pages them
out to a temporary file using direct sequential access. At some point, it
loses its sense of humour and crashes.

To fix this, add VBA to ensure that your user's copy of Word is running with
"Always Make Backup" switched ON, and "Allow fast saves" switched OFF. Then
insert a simple counter and perform a full save each 100 or so operations.

Things will run a lot faster and Word will stop crashing.

Note that users do horrible things to their computers. For bulk operations
such as this, you need to be utterly sure of your environment: there are
hundreds of settings and customisations a user can make that will interfere
with this thing: you need to explicitly SET them all. Never believe a user
when they say they have set something: set it yourself. Never assume that
anything you set will stay that way after the user gets his hands on the
keyboard: it won't. And never assume there are any particular contents in
either the normal template or the document: the content of a user's Normal
template is always "Undefined". If you want a clean blank document, call a
known good one from the network.

Note that Word 2000 leaks memory. Microsoft denies it, but it does. Advise
your users to Restart instead of Logging Off when they go home at night.
That way their system memory is clean and clear in the morning. Doing that,
I never had a crash in Word 2000 for two and a half years. Apart from the
crashes *caused* by my crappy coding :)

Hope this helps


This responds to article
from "avarghese" said:
Hi,

I have an application that pulls data from the database and displays them in
Word documents. How it works is:

1) An client-server interface allows the user to choose whether to start a
new document or open an existing one.
2) The client server interface opens Microsoft Word and attaches a template
to it. From here on Word takes over and the
client-server application is no more relevant. All user-interface
capabilities are implemented in Word using VBA. The
version of Word we use is Word 2000.
3) A VBA screen with a list of sections pops up and asks the user to select
the record and the sections that need to be
displayed for that record. User selects and presses "Finish".
4) Word pulls data related to the selected record and relevent to the
sections selected by the user and formats them into
paragraphs/tables and puts them in a word document. Word also paginates
and indexes the document. Document size
could range from just 50 pages to 800 pages depending on user
selection. Word pulls this data from a web-server by
invoking the url which returns an XML document along with data and some
minimal formatting back to Word.
5) Once the document is displayed the user may re-paginate/re-index or
refresh different sections or all sections of the
document.
6) User may also archive a document and next year work with the same
document to refresh what has changed in a
years time.

However, I found that whenever the document is more than 500 pages in size,
Word crashes if the user tries to paginate/re-index or if the user simply
navigates down the pages in the document. I think this could be because of the
size of the document. Looks like Word cannot handle exceptionally large
documents. I'm not sure.

This is where I need some advice. I planned to try and split up this document
based on user inputs. Along with selecting sections to put into the document,
the user will also be asked to choose which sections should be within the
document and which ones should be appendages. The the document generation
utility should generate different documents with reference links to those
appendages. However, when the user prints the main document, it should print
the other documents seamlessly as if it is one document. That is one solution.

Another solution is to move the forms (screens) out of the VBA template file
(there are currently 11 screens for various requirements) onto my
client-server application and leave only the document generation code within
the template. It could be possible that Word cannot handle such a large
template file as an attachment. The size of the template file is 685 KB.

I need some kind of advice or help. I need to know whether I am on the right
track. Is it true that Word cannot handle large template files as attachments?
Is it true that Word cannot handle documents that are bigger than 500 pages?
If so, what is the best solution to this problem? The clients are not too
happy with upgrading their machines to higher configurations. They currently
have Pentium III with Windows 2000 installed, about 4GB HDD and 125MB-256MB
RAM. So thats not really bad configs. So, whatever enhancements/improvements
have to be handled within my application. I'd really appreciate any help.

Thank you,
Alex

--

Please respond only to the newsgroup to preserve the thread.

John McGhie, Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top