BUG: Accessing Shapes.Count of Consecutive WordMail Documents Fails

ID: Q242789


The information in this article applies to:
  • Microsoft Outlook, versions 2000, 97, 98
  • Microsoft Word 2000


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 this to be a bug in the Microsoft products 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:


  2. 
    MsgBox "Count = " & ActiveDocument.Shapes.Count 
  3. Create a new toolbar and associate the macro with the toolbar you just created.


  4. Save the template to the Office/Startup directory where Microsoft Office is installed so that it will be used for all new Word documents.


  5. 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.


  6. Create a new Mail Message.


  7. Run the macro by clicking the Toolbar button. A message displays the count of shapes (which should be zero).


  8. Close the message.


  9. Create another new Mail Message


  10. Run the macro once more by clicking the Toolbar button, and note that the error message above occurs.


Additional query words: shapes count wordmail

Keywords : kberrmsg kbtemplate kbAutomation kbOutlook kbOutlook97 kbOutlook98 kbOutlookObj KbVBA kbWord kbGrpDSO kbDSupport kboutlook2000 kbword2000
Version : WINDOWS:2000,97,98
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: October 11, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.