Update custom "date modified" field on SAVE?

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
 
S

Sue Mosher [MVP]

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
 
G

Guest

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
 
S

Sue Mosher [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top