Microsoft KB Archive/242789

= BUG: Accessing Shapes.Count of Consecutive WordMail Documents Fails =

Article ID: 242789

Article Last Modified on 1/25/2007

-

APPLIES TO


 * Microsoft Outlook 2000 Standard Edition
 * Microsoft Outlook 97 Standard Edition
 * Microsoft Outlook 98 Standard Edition
 * Microsoft Word 2000 Standard Edition

-



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
  Make a new Microsoft Word template. Add a macro containing the following code: MsgBox "Count = " & ActiveDocument.Shapes.Count  Create a new toolbar and associate the macro with the toolbar you just created. Save the template to the Office/Startup directory where Microsoft Office is installed so that it will be used for all new Word documents. 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. Create a new Mail Message. Run the macro by clicking the Toolbar button. A message displays the count of shapes (which should be zero).</li> Close the message.</li> Create another new Mail Message</li> Run the macro once more by clicking the Toolbar button, and note that the error message above occurs.</li></ol>

Additional query words: shapes count wordmail

Keywords: kbautomation kbbug kberrmsg kboutlookobj kbpending kbtemplate KB242789

-

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

© Microsoft Corporation. All rights reserved.