Article ID: 259626 - Last Review: September 7, 2006 - Revision: 2.0

OL98: CurrentItem or CurrentFolder Methods Return the Wrong Item or Folder

This article was previously published under Q259626
Expand all | Collapse all

SYMPTOMS

Your Visual Basic Scripting Edition (VBScript) code does not behave as expected or performs operations on an incorrect folder or item.

CAUSE

You used either the ActiveInspector.CurrentItem method or the ActiveExplorer.CurrentFolder method to reference the current item or folder in which the item is stored.

RESOLUTION

In VBScript, use the Item object to refer to the current item, and use the folder object from the Item.Parent property to refer to the current folder.

MORE INFORMATION

If you use the ActiveInspector or ActiveExplorer objects in a production environment, the user may click to switch items or folders and your code then references the item or folder that the user clicked. While in most cases this is improbable, it can theoretically happen and has occurred in some production environments.

Use the CurrentItem property and the CurrentFolder property when your code is based outside the context of a custom Outlook form. This can be either Microsoft Outlook Visual Basic for Applications or when you use Automation to program Outlook.

REFERENCES

For additional information about creating solutions with Microsoft Outlook, click the article numbers below to view the articles in the Microsoft Knowledge Base:
180826  (http://support.microsoft.com/kb/180826/EN-US/ ) OL98: Resources for Custom Forms and Programming
182349  (http://support.microsoft.com/kb/182349/EN-US/ ) OL98: Questions About Custom Forms and Outlook Solutions

APPLIES TO
  • Microsoft Outlook 98 Standard Edition
Keywords: 
kbprb KB259626
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations