Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automating a mail merge
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01193945
Message ID:
01194039
Vues:
21
In unrelated thread that I'm attempting to move here, I asked Marcia Akins this:

1) when printing does VFP wait for Word to complete the task or does it go on (like after the MailMerge.Execute command?) and therefore cause a potential locking issue if it tries to update the data source that Word is still using

Marcia:
I do not know for sure, but it seems to me that the printing operation, like any other command sent to an automation server, would be asynchronous. But I do not know about any potential "locking issue".

2) are you aware that the OpenDataSource command is no longer necessary in Word versions 10 and above?

Marcia
No. But, then again, that conference session was written in 2002 and I have not used MailMerge for any of my recent work. I have used templates with bookmarks in them and a metadata driven class to replace the bookmarks.

Ok here's my reply:

I'm thinking it's asynchronous, also. Will need to make some adjustments in this high volume environment.

It appears that in versions 10 and 11, the OpenDataSource command is no longer necessary and it results in a dialog asking the user's permission to run the query on the data source (a real pain when printing lots of letters). Anyway, I check the version of Word and execute that command as necessary.

It seems you're implying that the bookmarking technique is a replacement for the mailmerge. I wouldn't think of bookmarks for mailmerges, but I'm not doing a ton of mailmerging, so I wouldn't call myself an expert on this. Maybe you could fill me in on this technique in more detail?


>I automate Word to do mail merges for clients, but one client seems to be having some issues I normally don't see. First, they are doing a lot of initial printing and then the amount they do each day will taper off to some relatively small number between (guessing) 50 and 150 documents. This application is run under Terminal Services. There are about 390 documents and they have to be sent out to 3 or 4 thousand times intially. Printing started out fine, but the last couple of days they've run into locking problems (only one person is printing at the moment AFAIK). Each document uses the same Excel file for its data source. The data source is repopulated between each document, the document prints, the data source is repopulated, then the next document prints.
>
>So I thought maybe I'd use a different data source for each document. I have a program to attach a data source to a Word doc and it worked great to attach the one single data source to each document, but when attaching a different data source to each document there are problems. I've discovered that if Excel is already open when the program is run, it works much faster (60 seconds per doc when Excel is not already open and just over 5 seconds per doc when Excel is open). The problem is that altough Word did not open Excel, it did open the data source doc (the spreadsheet) and it seems it would close the data source document, too. Yet it does not and I'm left with a bunch of open Excel docs. Not that big of a deal, but I'd be left with 390 spreadsheets open in Excel and I'm not sure how my computer will handle that (can you even have that many open docs in Excel).
>
>Why the speed difference mentioned above and why is Word leaving the Excel spreadsheet file open? I'd post a code example, but I'm falling asleep at the keyboard. Please post any suggestions you have and I'll try to get some code out here.
eCost.com continues to rip people off
Check their rating at ResellerRatings.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform