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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement