Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: Office Automation
Thread ID: 209577 Message ID: 209681 # Views: 3 # Ratings: 0
Version: Visual FoxPro 7 Category: Forms
Date: Tuesday, December 30, 2008 1:31:09 PM         
   


> >
> > Design in Word, save as RTF. Use TextMerge in VFP to replace token with data, send to Word to print.
> > -Anders
>
>
> Could you send me any example
>
> Thnx in advance
> Ahsan Rana

Create the Word document such as:

{{M.cfirstname}} {{M.cLastname}}
Dear {{M.cFirstname}}
Please pay invoice {{M.inv_no}} at once.
{{M.dDate}}
Ahsan Rana


Save aS RTF with a name like DUNNING1.RTF

* Code in VFP
letter1 = FILETOSTR('dunning1.rtf') 
USE Invoices 
SCAN FOR notpaid
 cFirstnems=Invoices.firstname
 cLastName=Invoices.lastname 
 inv_no = Invoices.id
 dDate= DATE()
 cRTF=TEXTMERGE(letter1, .F. '{{','}}') 
 STRTOFILE(M.cRTF, 'RTF'+TRANSFORM(inv_no)+'.RTF'
ENDSCAN 


Send your textmerged rtf-files to Word for printing. That part can be programmed too.
Note: I've used {{ and }} as start and end delimiters instead of the standard ones, as the standard ones can't be used in a Foxite text.

-Anders

ENTIRE THREAD

Office Automation Posted by Ahsan Rana @ 12/29/2008 5:43:40 PM
RE: Office Automation Posted by Anders Altberg @ 12/29/2008 5:57:50 PM
RE: Office Automation Posted by Ahsan Rana @ 12/29/2008 6:42:14 PM
RE: Office Automation Posted by Anders Altberg @ 12/30/2008 1:31:09 PM
RE: Office Automation Posted by Biju Thomas @ 12/30/2008 3:13:41 AM
RE: Office Automation Posted by Anders Altberg @ 12/30/2008 12:56:46 PM
RE: Office Automation Posted by Cetin Basoz @ 12/29/2008 7:09:42 PM
RE: Office Automation Posted by Ahsan Rana @ 12/30/2008 6:01:31 AM
RE: Office Automation Posted by Cetin Basoz @ 12/30/2008 2:28:03 PM
RE: Office Automation Posted by Yousfi Benameur @ 12/29/2008 10:36:49 PM
RE: Office Automation Posted by Biju Thomas @ 12/30/2008 3:23:16 AM
RE: Office Automation Posted by Yousfi Benameur @ 12/30/2008 2:04:47 PM
RE: Office Automation Posted by Ahsan Rana @ 12/30/2008 5:48:52 AM
RE: Office Automation Posted by Yousfi Benameur @ 12/30/2008 2:15:45 PM
RE: Office Automation Posted by Ahsan Rana @ 12/31/2008 5:55:57 AM
RE: Office Automation Posted by Anders Altberg @ 12/30/2008 5:06:44 PM
RE: Office Automation Posted by Ahsan Rana @ 12/31/2008 5:53:31 AM
RE: Office Automation Posted by Yousfi Benameur @ 12/30/2008 2:00:54 PM
RE: Office Automation Posted by Cetin Basoz @ 12/30/2008 3:52:57 PM
RE: Office Automation Posted by Yousfi Benameur @ 12/30/2008 6:30:56 PM
RE: Office Automation Posted by Ahsan Rana @ 1/1/2009 6:37:54 AM