>The app we're writing in VFP5 uses Word (Office 97) to mail-merge letter, labels, etc.
>
>The letters and labels are setup in Word and use a Word table as the datasource. We print each letter as it's own print job to prevent wasted letterhead. Sometimes very expensive stuff. It works something like this:
>
>1) Fill in word table
>2) Merge letter
>3) Print letter
>4) Close merged letter
>5) Delete row in word table
>6) Add row in word table
>7) Repeat
>
>What we're finding is a big speed issue around the #1. There are as many as 15 potential fields to fill in. 15 different calls to Word is not a quick thing.
>
>We've tried using Fox tables through ODBC as the data source but had issues with international characters. They seem to be more consistent through Word tables. (I could be wrong here).
>
>The solution I've come up with is to try to use macros within Word to speed up some of the processing. I'd like to write a macro that receives data from VFP and puts it into the right row in the table. So the call would look something like this:
>
>_____.filltable("Paul Witt","ParagonCo","5285 Brown Rd",2)
>
>It would fill in the first 3 columns of row 2 with the sent information.
>
>I can write a simple macro in Word. I can use the application.run command to execute this macro from within VFP. But how do I write a macro (method) in Word that accepts parameters? And how do I call this macro from VFP? Is it possible at all?
>
>Any help, code or other ideas would be greatly appreciated. I'll even buy you a drink at Devcon if you come up with the key. :)
>
>paul
Paul,
I've implemented something similar in another fashion.
1) From VFP open Word,
2) Open a template Word document filled with some bookmarks
2) Replace the bookmarks with VFP data.
3) Copy the finished document into a master DOC File
4 Close the template
5) Start over at 2)
The reason I had to this is because I'm obliged to use different templates acording to the language of the recipient.
On a PII 300 with 192MRAM I get around 50 docs generated by minute (with 10 bookmarks each).
José