How to Set Width of Embedded Memos in Text Merge Output

Last reviewed: June 27, 1995
Article ID: Q113921
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, and 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.5, 2.5a, 2.5b, and 2.6

SUMMARY

A useful feature of the TEXTMERGE command is the ability to output a form letter containing text merge delimited fields that have been stored in the memo field of a database. Unfortunately, the SET MEMOWIDTH TO command is ignored for any memo fields that are embedded in the form letter.

To work around this behavior, use the following user-defined function (UDF), which allows the memo text to appear at the desired location and wrap at the column specified by SET MEMOWIDTH TO.

MORE INFORMATION

Assuming a desired width of 35 for the memo field (starting at the 20th column), you can create the UDF as follows:

  1. In the Command window, type:

          MODIFY COMMAND limit
    

    NOTE: You can replace the UDF name "Limit" with another name, of 8 characters or less, conforming to the MS-DOS file-naming conventions.

  2. In the LIMIT.PRG edit window, type the following lines:

          SET MEMOWIDTH TO 35
          ?? Comments AT 20
          RETURN ""
    

To use this solution, replace the memo field name in the form letter with the name of the UDF. For example, wherever the memo field appears as "<<Comments>>" in the form letter, it should now say "<<Limit()>>" (without the quotation marks).


Additional reference words: FoxDos FoxWin 2.50
KBCategory: kbprg
KBSubcategory: FxprgGeneral


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.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.