DOCUMENT:Q97644 09-FEB-2001 [foxpro] TITLE :HOWTO: Merge Text from a Memo Field PRODUCT :Microsoft FoxPro PROD/VER::2.0,2.5,2.5a,3.0,5.0,6.0 OPER/SYS: KEYWORDS:kbvfp300 kbvfp500 kbvfp600 kbGrpDSFox kbDSupport ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, versions 3.0, 5.0, 6.0 - Microsoft FoxPro for Windows, versions 2.5, 2.5a - Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a ------------------------------------------------------------------------------- SUMMARY ======= Memo fields provide a powerful way to implement text merges in FoxPro. The information below provides the code to print the contents of memo fields containing the text for a text merge. MORE INFORMATION ================ In this example, the memo field contains the text to be merged with the text merge components. The page spacing (top, bottom, and side margins) is controlled within the memo field. A sample memo field will appear much like this: <> <> <> <> <>, <> <> Dear <>: This area includes the body of a letter to be sent to the contact. Sincerely, Author's name The following code prints the letter from the memo field shown above. The text merge components (the fields and such) are in the SAMPLE\DBFS subdirectory of FoxPro for MS-DOS and the SAMPLE\ORGANIZE\DBFS subdirectory of FoxPro for Windows. CLEAR SET PRINTER ON SET TEXTMERGE ON && enable evaluation of components SET TALK OFF && prevents printing of commands SET TEXTMERGE DELIMITERS TO && set default delimiters SET MEMOWIDTH TO 80 && sets memo width for 80 columns USE Clients SCAN && forces top-down processing FOR J=1 TO MEMLINES() && processes each line in memo field X="\"+MLINE(,J) &X && macro substitution ENDFOR ENDSCAN NOTE: If the print job doesn't print until you quit FoxPro, see the following article in the Microsoft Knowledge Base: Q102203 BUG: Print Job Is Not Released to Printer Additional query words: VFoxWin FoxDos FoxWin ====================================================================== Keywords : kbvfp300 kbvfp500 kbvfp600 kbGrpDSFox kbDSupport Technology : kbVFPsearch kbAudDeveloper kbFoxproSearch kbZNotKeyword3 kbFoxPro200DOS kbFoxPro250DOS kbFoxPro250aDOS kbFoxPro250 kbFoxPro250a kbVFP300 kbVFP500 kbVFP600 Version : :2.0,2.5,2.5a,3.0,5.0,6.0 Issue type : kbhowto ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2001.