Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MailMerge using Windows printer
Message
De
08/01/2005 18:47:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00970262
Message ID:
00975461
Vues:
23
>Hi Cetin
>Am taking your suggestion to create a dummy vfp report with a single memo field in it & using a dummy grouping to kick to a new page for each letter.
>Question:
>How do I get each page of the TextMerge output into a memo field (creating individual records in a vfp table for each page)?
>
> You can "set TextMerge to m.Variable" or "set TextMerge to textmerge.txt", but this puts the entire output there.
>Don't want to build a low level file routine to break these letters apart if it can be avoided.
>All help appreciated.
>Bill Wright

Hi Bill,

set textmerge is controllable. ie:
create cursor Dummy (recData m)
FieldsToMemo('employee')
select Dummy
Browse


* Put each record of table into a memo field of cursor
Function FieldsToMemo
Lparameters tcTable
If !Used(m.tcTable)
  USE (m.tcTable) In 0
EndIf
Select (m.tcTable)
scan
 insert into Dummy values (RecordtoMemo(m.tcTable))
endscan


function RecordToMemo
Lparameters tcAlias
local m.RecordAsText, m.ix
Select (m.tcAlias) && There is a bug with field() if not currently selected area returns wroninfo
set textmerge to memvar m.RecordAsText noshow
set textmerge on
for ix = 1 to fcount(m.tcAlias)
 if type(field(m.ix,m.tcAlias)) != 'G'
   if m.ix = 1 
     \\<<Field(m.ix,m.tcAlias)>>: <<Eval(m.tcAlias+'.'+field(m.ix,m.tcAlias))>>   
   else
     \<<Field(m.ix,m.tcAlias)>>: <<Eval(m.tcAlias+'.'+field(m.ix,m.tcAlias))>>   
   endif 
 endif
endfor
set textmerge to
set textmerge off
return m.RecordAsText
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform