Update custom "date modified" field on SAVE?

  • Thread starter Thread starter AmyG
  • Start date Start date
A

AmyG

I've designed a custom form in Outlook 2002 which has a
Date created and Date modified field. Is there a way
design the form so the fields are automatically updated to
the current date when it is created, and then subsequently
each time it is saved? I found a Visual Basic macro that
would update the field if I ran it after each time I
modified something, but since this is for an office-wide
database and I will not be the only one adding/editing
entries, it would be great if I could just program it into
the form.

Thanks!

Amy
 
Try:

Function Item_Write()
If Item.EntryID= 0 then
Item.UserProperties("Date Created") = Now()
End If
Item.UserProperties("Date Modified") = Now()
End Function

FYI, there is a newsgroup specifically for Outlook forms issues "down the
hall" at microsoft.public.outlook.program_forms
 
Thanks. However, I hate to profess my ignorance, but I'm
unsure how to use this code - I'm pretty new to this type
of programming. Can you elaborate?

I'll also check with the programming newsgroup.

Thanks
 
With the form in design mode, click the View Code button and copy the code
into that window. You must then publish the form and use the published
version to create new items. See http://www.slipstick.com/dev/forms.htm for
more forms basics.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top