WD: Text Form Fields Not Retained During Mail Merge

Last reviewed: February 19, 1998
Article ID: Q146644
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows 95, versions 7.0, 7.0a

SYMPTOMS

A mail merge main document that contains form fields retains the drop-down and check box form fields, but text form fields are not present in the merge result.

CAUSE

Word unlinks the text form fields during the mail merge. Word does not unlink display form fields, such as the drop-down and the check box form fields. This behavior is by design.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

     
   http://www.microsoft.com/support/supportnet/refguide/default.asp

Instead of inserting text form fields into the mail merge main document, insert a placeholder, merge to a new document, and then replace the placeholder with the text form field. Use the following macro to replace the placeholder with a text form field.

NOTE: The drawback to this method is that you cannot merge directly to a printer; you must merge to a document, run the macro and then print the document.

   Sub MAIN
      StartOfDocument
      ' Turn screen updating off.
      ScreenUpdating 0     
      ' Note that "<TEXTFIELD>" (below) needs to be whatever the user has as
      ' a temporary text form field "replacement" in their original merge
      ' document.
      EditFind .Find = "<TEXTFIELD>", .Direction = 0, .Wrap = 1
      ' This makes sure that there are actually more "fields" to replace
      ' before putting in a new form field. Without this it would endlessly
      ' insert text form fields at the end of the document.
      While EditFindFound()
        InsertFormField .Enable = 1, .TextType = 0, .TextWidth = "0"
        EditFind
      Wend
      ScreenUpdating 1   'Turn screen updating back on.
      StartOfDocument
   End Sub

MORE INFORMATION

Some fields, such as the Next and FillIn fields require input either from the data document or from you to continue processing the merge. In this case, Word places the results in the merged document. However, fields that obtain information from document statistics, such as the Numpages field, may be inappropriate for a merged document. As a result they are not retained in the merge result.

The following fields are not unlinked during a mail merge:

   = (Formula)
   Advance
   AutoNum
   AutoNumLgl
   AutoNumOout
   BarCode
   Date
   EQ
   FormCheckbox
   FormDropDown
   GotoButton
   IncludePicture
   IncludeText
   Link
   MacroButton
   NoteRef
   Page
   PageRef
   Print
   PrintDate
   Private
   RD
   Section (except in Word for the Macintosh version 6.0 and 6.0.1)
   SectionPages
   Symbol
   TA
   TC
   Time


Additional query words: text form mail merge mailmerge lost stripped
removed disappear print merge merging display field formfield drop down
dropdown
Keywords : kbfield kbmacroexample kbmerge macword ntword winword word6 word7 word95 wordnt macword6 kbcode
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH Win95 WINDOWS winnt
Issue type : kbbug kbinfo
Solution Type : kbworkaround


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: February 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.