Help and Support
 

powered byLive Search

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

Article ID:828499
Last Review:January 26, 2007
Revision:5.2

SYMPTOMS

When you run a Microsoft Visual Basic for Applications (VBA) macro in Microsoft Office Word 2007 or 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.

Back to the top

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.

Back to the top

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.

Back to the top


APPLIES TO
Microsoft Office Word 2007
Microsoft Office Word 2003

Back to the top

Keywords: 
kberrmsg kbprb KB828499

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.