Microsoft KB Archive/146644

= WD: Text Form Fields Not Retained During Mail Merge =

PSS ID Number: 146644

Article Last Modified on 5/13/2002

-

The information in this article applies to:


 * Microsoft Word for Windows 6.0
 * Microsoft Word for Windows 6.0a
 * Microsoft Word for Windows 6.0c
 * Microsoft Word for the Macintosh 6.0
 * Microsoft Word for the Macintosh 6.0.1
 * Microsoft Word for the Macintosh 6.0.1a
 * Microsoft Word for Windows NT 6.0
 * Microsoft Word for Windows 95 7.0
 * Microsoft Word for Windows 95 7.0a

-



This article was previously published under Q146644





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 professionals 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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

http://www.microsoft.com/partner/referral/

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

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 "" (below) needs to be whatever the user has ' as a temporary text form field "replacement" in their original ' merge document. EditFind .Find = "", .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 table lists which fields are not unlinked and which fields are unlinked during a Word mail merge.   Fields that are                   Fields that are not unlinked                     unlinked -  = (Formula)                       Ask Advance                          Author AutoNum                          AutoText AutoNumLgl                       AutoTextList AutoNumOut                       Comments BarCode                          Compare Date                             CreateDate EQ                               Database FormCheckbox                     DocProperty FormDropDown                     DocVariable GotoButton                       EditTime IncludePicture                   FileName IncludeText                      FileSize Link                             FillIn MacroButton                      Hyperlink NoteRef                          If   Page                              Index PageRef                          Info Print                            Keyword PrintDate                        LastSavedBy Private                          ListNum RD                               Mergefield Section (See NOTE)               MergeRec SectionPages                     MergeSeq Symbol                           Next TA                               NextIf TC                               NumChars Time                             NumWords Quote Ref RevNum SaveDate Seq Set SkipIf StyleRef Subject Template Title TOA TOC UserAddress UserInitials UserName NOTE: The Section field in Word for the Macintosh version 6.0 and 6.0.1 will be unlinked.

Additional query words: text form mail merge mailmerge lost stripped removed disappear print merging display field formfield drop down dropdown

Keywords: kbbug kbdtacode kbfield kbinfo kbmacroexample kbmerge KB146644

Technology: kbHWMAC kbOSMAC kbWord600 kbWord600a kbWord600c kbWord600Mac kbWord600NT kbWord601aMac kbWord601Mac kbWord95 kbWord95a kbWord95Search kbWordMacSearch kbWordSearch kbZNotKeyword2 kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.