The information in this article applies to:
SUMMARYMicrosoft Outlook 97 does not provide a Microsoft Visual Basic Scripting Edition (VBScript) event that executes only when a new Outlook item is created. This article describes a method you can use to simulate this functionality. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspWhen a new form is created, Outlook executes an Item_Open event in VB Script. However, once the item is saved in a folder, the Item_Open event will also execute when the item is reopened. In addition, Outlook will also execute the Item_Read event when an item is opened from a folder. The following sample VBScript code illustrates how you can place code in the Item_Open event so that it will only run when the item is first created. It checks to see if the Created field of the item is populated. If the Created field does not have a date value, the item must be a new item. If the Created field is populated with a date value, the item has already been saved and is therefore being reopened.
REFERENCESFor more information about creating solutions with Microsoft Outlook 97, please see the following articles in the Microsoft Knowledge Base: Q166368 OL97: How to Get Help Programming with Outlook Q170783 OL97: Q&A: Questions about Customizing or Programming Outlook Additional query words: OutSol OutSol97 initialize activate
Keywords : kbcode kbprg |
Last Reviewed: November 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |