User-defined fields are not available when you perform a mail merge in Outlook 2000 (832565)



The information in this article applies to:

  • Microsoft Outlook 2000

SYMPTOMS

When you perform a mail merge by using a Microsoft Outlook 2000 Contacts folder, and you click the Insert Merge Field in Microsoft Word, user-defined fields are not available.

CAUSE

This behavior occurs if either one of the following conditions is true:
  • The user-defined fields are not associated with the Outlook 2000 Contacts folder that you selected for the mail merge.
  • The custom form that contains user-defined fields is not set as the default form for the Outlook 2000 Contacts folder that you want to use for the mail merge.

RESOLUTION

To resolve this behavior, you must associate the user-defined fields with the Outlook 2000 Contacts folder before you perform the mail merge. You can manually or programmatically associate the user-defined fields with the specific Contacts folder.

Method 1

To manually associate the user-defined fields with your Contacts folder, follow these steps:
  1. Start Outlook 2000.
  2. Click the Contacts folder that you want to use in the mail merge.
  3. On the View menu, point to Current View, and then click Customize Current View.
  4. In the View Summary dialog box, click Fields.
  5. In the Show Fields dialog box, click New Field.
  6. In the Name box, type the user-defined field name, in the Type list, click the field type of the user-defined field, in the Format list, click the appropriate format, and then click OK.
  7. Repeat step 2 through 6 to associate the user-defined fields with the Contacts folder.

Method 2

To programmatically associate the user-defined fields with the Outlook 2000 Contacts folder, follow these steps:
  1. Set the custom form that contains user-defined fields as the default form to the Outlook 2000 Contacts folder. To do so, follow these steps:
    1. Start Outlook 2000.
    2. Click the Contacts folder that you want to use for the mail merge.
    3. Right-click the folder, and then click Properties.
    4. On the General tab, in the When posting to this folder, use list, click Forms.
    5. In the Choose Form dialog box, click the custom form that contains the user-defined fields, click Open, and then click OK.
  2. Use a Microsoft Visual Basic for Applications (VBA) script to associate the user-defined fields in the custom form to the Outlook 2000 Contacts folder. To do so, follow these steps:
    1. On the Tools menu, point to Forms, and then click Design This Form.
    2. On the Edit menu, click Select All, and then press DELETE.
    3. On the Form menu, click Control Toolbox.
    4. In the Toolbox dialog box, drag the CommandButton to the form.
    5. Right-click the CommnandButton, and then click Properties.
    6. In the Name box, type cmdUpdateFolderFields, and then click OK.
    7. Paste the following code in the Script Editor. To do so, follow these steps:
      • On the Form menu, click View Code.
      • In the Script Editor dialog box, paste the following code.
      Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to 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 requirements.
      Sub cmdUpdateFolderFields_Click()  
         Set MyItem = Application.Session.PickFolder.Items.Add
      	For Each UP in myItem.UserProperties
      		MyItem.UserProperties.Add UP.Name, UP.Type, TRUE
      	Next
         MsgBox "Done!"
      End Sub
      
    8. On the Form menu, click Run This Form.
    9. Click the CommandButton on the running form.
    10. In the Select Folder dialog box, click the Contacts folder, and then click OK.
    11. In the VBScript dialog box, wait for the Done! message to appear, and then click OK.
    12. Close the form without saving the changes.

MORE INFORMATION

For additional information about how to work with user-defined fields in Outlook 2000, click the following article number to view the article in the Microsoft Knowledge Base:

201438 OL2000: Working with user-defined fields in solutions


Modification Type:MinorLast Reviewed:1/9/2006
Keywords:kbprb KB832565 kbAudITPRO