BUG: Accessing Shapes.Count of Consecutive WordMail Documents Fails (242789)



The information in this article applies to:

  • Microsoft Outlook 2000
  • Microsoft Outlook 97
  • Microsoft Outlook 98
  • Microsoft Word 2000

This article was previously published under Q242789

SYMPTOMS

When you use Microsoft Word as the default editor for Microsoft Outlook e-mail messages, you can use a document template as a starting point. If the Word template contains code to access the Count of the Shapes collection and the template is used to create more than one message consecutively, the second and subsequent messages might fail with Error 424:
Object Required.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

This problem can be reproduced by several means, including using a Visual Basic ActiveX DLL, a Visual Basic ActiveX EXE, or a Visual C++ DLL. However, the simplest method for reproducing the error is to use Visual Basic for Applications macro code.

Steps to Reproduce Behavior

  1. Make a new Microsoft Word template. Add a macro containing the following code:
    MsgBox "Count = " & ActiveDocument.Shapes.Count
  2. Create a new toolbar and associate the macro with the toolbar you just created.
  3. Save the template to the Office/Startup directory where Microsoft Office is installed so that it will be used for all new Word documents.
  4. Launch Microsoft Outlook. From the Tools menu, select Options and then choose the Mail Format tab. Check the box to use Microsoft Word to edit e-mail messages and set the default mail format to Microsoft Outlook Rich Text.
  5. Create a new Mail Message.
  6. Run the macro by clicking the Toolbar button. A message displays the count of shapes (which should be zero).
  7. Close the message.
  8. Create another new Mail Message
  9. Run the macro once more by clicking the Toolbar button, and note that the error message above occurs.

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:kbAutomation kbbug kberrmsg kbOutlookObj kbpending kbtemplate KB242789