Article ID: 293797 - Last Review: June 18, 2008 - Revision: 2.2 Memory or performance problems looping through itemsThis article was previously published under Q293797 IMPORTANT: This article contains information about modifying the registry. Before you
modify the registry, make sure to back it up and make sure that you understand how to restore
the registry if a problem occurs. For information about how to back up, restore, and edit the
registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986
(http://support.microsoft.com/kb/256986/EN-US/
)
Description of the Microsoft Windows Registry
On This PageSYMPTOMS
You use the Outlook object model to loop through items in a folder, but run into memory limitations, or the amount of time that it takes to process an item increases as the collection of items is processed.
CAUSE
The items are based on a custom form that uses Microsoft Visual Basic Scripting Edition (VBScript), and Outlook does not release memory related to VBScript until the entire collection of items is processed.
RESOLUTION
You can add a registry key to limit the number of times that Outlook loads the VBScript code. WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk. Create the following DWORD registry key based on your version of Outlook, and set the value to a number that is larger than 0. Outlook 2002 HKEY_LOCAL_MACHINE\Software\Microsoft\Office\10.0\Outlook\Scripting\Threshold Outlook 2003
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\11.0\Outlook\Scripting\Threshold
Outlook 2007HKEY_LOCAL_MACHINE\Software\Microsoft\Office\12.0\Outlook\Scripting\Threshold
Outlook limits the number of simultaneous script objects to that number. You can set it to any small number, which allows most looping scenarios to run. However, Microsoft recommends you set it to a value in the range of 10 to 20 because after you implement this registry key, custom forms that are opened through the Outlook user interface are also affected. For example, if you set the value to 2, and then open three custom forms with VBScript in them, the VBScript code will not run in the third item you open.
WORKAROUND
Depending on what types of items that you are processing and what fields you need to access, you may be able to use the Collaboration Data Objects (CDO) object model to access the items instead of the Outlook object model.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. MORE INFORMATIONSteps to Reproduce ProblemNOTE: Use a Microsoft Window NT or Microsoft Windows 2000-based computer so that you can later see memory usage by using the Windows Task Manager.
REFERENCESFor additional information about available resources and answersto commonly asked questions about Microsoft Outlook solutions, click the article number below
to view the article in the Microsoft Knowledge Base:
287530
(http://support.microsoft.com/kb/287530/EN-US/
)
OL2002: Questions About Custom Forms and Outlook Solutions
| Article Translations
|
Back to the top
