 |
Search
IT Courses |
|
|
|
|
|
|
|
|
|
|
|
IT
dart News Letter
|
Get
ITdart.com weekly headlines before it's published on our site! Subscribe
and receive the articles delivered to your inbox!
|
|
|
Outlook 97
When 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.
Sub Item_Open() MsgBox "This is the Item_Open event." ' 1/1/4501 represents a date field with no value. If Item.CreationTime = #1/1/4501# Then MsgBox "Open: create code goes here." Else MsgBox "Open: item opened code goes here." End If End Sub
|
|
|