Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Mail merge crashing with many records
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01417134
Message ID:
01417160
Vues:
50
>I have a form where the user can print the invoices for a batch of client. Each invoice can be preceded by a cover letter written in Word by the user. The printout is done on a multiple bins printer.
>
>Here's the logic:
>- Create the cursor for the cover letters
>- Create the cursor for the invoices
>- Create the mail merge in Word:
> - Open an instance of Word
> - Open the letter
> - Set the data source
> - Start the mail merge
>- For each invoice:
> - Set the printer bin to the cover letter paper
> - Go to page n in Word
> - Select the page
> - Print the page
> - Set the printer bin to the invoice paper
> - Print the invoice
>
>The result is a printout where no assembly is necessary since the cover letter and the invoice for each client are printed togheter.
>
>This was working well for the past year or so, but now we are facing with a major problem. When printing more that 1,000 invoices, Word seem to choke and the process slow to a crawl until Word crash in the end with a "Not enough space" error message. In the task manager, I see the Word process taking around 25% of the CPU (still OK), but the memory consumption grow over 800MB before crashing. It take around 3 or 4 minutes to print a page.
>
>I've done tests with Vista and Word 2007 and with XP and Word 2003 and both give the same result.
>
>Here's the time it take to complete the process:
>- 100 invoices -> 0:02:14
>- 1,000 invoices -> 1:31:41 (should have taken around 20 minutes)
>- 2,000 invoices -> Word crash
>
>The solution I see would be to break down the merge process in batches of 100 records instead of a single batch, but it will require changes in the system that I would like to avoid.
>
>Anyone have an idea of why this process won't work anymore? Any testing I should do to locate and fix the problem?
>
>TIA

If I understand it correctly, you print invoices separately, one invoice after another having many Word printer jobs in the line. If it is the case, then consider either creating a separate Word document for single printout, or wait while Word is printing one job before creating another print job, like
declare Sleep in Win32api integer
do while !empty(oWord.Application.BackgroundPrintingStatus)
	=Sleep(1000)
enddo
Good Luck
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform