Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Mail merge ?
Message
From
03/02/2005 20:44:34
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00983548
Message ID:
00983721
Views:
14
Thanks Borislav. Looks like it should work great. I will try tommorrow.

>>Hi All
>>
>>I have been doing some mail merger stuff with Word 2003 and have a couple of questions.
>>
>>1. When merging to a document, word creates a second document with the results. Is there a way to only make the result document visible?
>>
>>2. How can I set focus to the result word document ?
>>
>>Thanks.
>
>
>How about:
>
>oWord.Visible = .f.
>oWord.ActiveDocument.MailMerge.EditMainDocument
>WITH oWord.ActiveDocument.MailMerge
>     .Destination        = 0           && File
>     .Execute(.t.)
>ENDWITH
>cWrdName = oWord.ActiveDocument.Name
>doc_to_close = 1
>DO WHILE oWord.Documents.Count > 1
>   nDoc = oWord.Documents(doc_to_close)
>  IF .NOT. cWrdName == nDoc.Name
>     nDoc.Close(0)
>  ELSE
>     doc_to_close = doc_to_close + 1
>  ENDIF
>ENDDO
>oWord.Visible    = .t.
>oWord.Activate()
>
Previous
Reply
Map
View

Click here to load this message in the networking platform