Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE Automation with WordPerfect 8
Message
From
27/11/1998 11:27:54
 
 
To
30/10/1998 09:37:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00147178
Message ID:
00161959
Views:
47
Sorry it took so long to get back to you. Here are two examples with
merging with WordPerfect 8

The following shows how I merge using OLE with WordPerfect :

lowp = createobject('Wordperfect.PerfectScript')
=lowp.mergerun(2,lcMaster, 2, lcSecondary,0)
&& lcMaster is a fully qualified filename of a wordperfect merge file
&& lcSecondary is a fully qualified filename of a wordperfect data file

doevents()
=lowp.quit()
lowp = NULL


The following is an example of how I make a wordperfect data file to use for
merging. To make the datafile, I have already done two things:

1. I have skelton of the datafile already set up. This skelton file
is a wordperfect data file that has the names of the fields to be used for
merging in it. It looks something like this:

FIELDSNAMES(NAME;ADDRESS;CITY;STATE;ZIP)
ENDRECORD

2. I have made a temporary table containing all the records I want merge
and all the fields that are needed for the merge.


lcHeaderfile = && the name of the skelton file described above in 1
lcDatatable = && the name of the table containing the data described above in 2

lcDatafile = && the name of the wordperfect file that is going to be created. Make sure it has a .SEC extention


use (lcDatatable) in 0 alias datatable again
select datatable

lnFldCount = fCount()

local dimension laFields[lnFldCount]

for lncounter = 1 to lnFldCount
laFields[lncounter]=field(lncounter)
endfor


lowp =createobject('WordPerfect.PerfectScript')

=lowp.fileopen(lcHeaderfile )
doevents()
=lowp.posDocBottom()

scan
for lncounter = 1 to lnFldCount
lcData = alltrim(eval(lafields(lncounter)))
=lowp.type(lcData)
=lowp.mergeendField
endfor
=lowp.mergeendRecord
doevents()

endscan

=lowp.mergefiletype(4)
=lowp.filesave(lcDatafile)

doevents()

=lowp.closenosave()

select datatable
use

=lowp.quit()
lowp=null


I hope this helps.

BTW. Wordperfect just released another service patch for Wordperfect. It
seems to make it more stable. You can download it from their FTP site

-Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform