You receive a "Requested object is not available" error message when you run a VBA macro during a mail merge in Word 2003 (828499)



The information in this article applies to:

  • Microsoft Office Word 2003

SYMPTOMS

When you run a Microsoft Visual Basic for Applications (VBA) macro in Microsoft Office Word 2003 that retrieves recipient information from a database, you may receive the following Run-time error message:
Requested object is not available.

CAUSE

This behavior may occur if you use the ActiveDocument.MailMerge.DataSource.Included property in your VBA macro and the database contains fewer than 10,000 records.

Note Databases that contain more than 10,000 records typically do not have recipient information.

WORKAROUND

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.

To work around this behavior, add the following Show method to your VBA macro:
Application.Dialogs(wdDialogMailMergeRecipients).Show 1000
Note This method will show the Mail Merge Recipients dialog box for one second, and then continue with your macro.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kberrmsg kbprb KB828499 kbAudEndUser kbAudDeveloper