Microsoft KB Archive/832565

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

Article ID: 832565

Article Last Modified on 1/9/2006

-

APPLIES TO


 * Microsoft Outlook 2000 Standard Edition

-





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:  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:  Start Outlook 2000. Click the Contacts folder that you want to use for the mail merge. Right-click the folder, and then click Properties. On the General tab, in the When posting to this folder, use list, click Forms. In the Choose Form dialog box, click the custom form that contains the user-defined fields, click Open, and then click OK.</li></ol> </li> 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: <ol style="list-style-type: lower-alpha;"> On the Tools menu, point to Forms, and then click Design This Form.</li> On the Edit menu, click Select All, and then press DELETE.</li> On the Form menu, click Control Toolbox.</li> In the Toolbox dialog box, drag the CommandButton to the form.</li> Right-click the CommnandButton, and then click Properties.</li> In the Name box, type cmdUpdateFolderFields, and then click OK.</li>  Paste the following code in the Script Editor. To do so, follow these steps: <ul> On the Form menu, click View Code.</li> In the Script Editor dialog box, paste the following code.</li></ul>

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 &quot;Done!&quot; End Sub </li> On the Form menu, click Run This Form.</li> Click the CommandButton on the running form.</li> In the Select Folder dialog box, click the Contacts folder, and then click OK.</li> In the VBScript dialog box, wait for the Done! message to appear, and then click OK.</li> Close the form without saving the changes.</li></ol> </li></ol>

<div class="moreinformation_section">

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

Keywords: kbprb KB832565

-

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

© Microsoft Corporation. All rights reserved.