User-defined Field

G

Guest

I leave mail in the Inbox folder until I'm finished working it (it may be as
long as weeks or months). At times my finger slips and I end up deleting
mail I didn't want to delete. As the mail could have been received a
thousand mails ago, searching through the date received is not much help. I
added a "Date Deleted" column to the Outlook Deleted Items folder to make the
search easier. However, I can't get it to work.

While in the Deleted Items folder, I went into the Field Chooser and looked
at all the available fields, Date Deleted was not there. I then went to
User-defined fields and added a new field: Name: Date Deleted, Type:
Date/Time, and Format: default (e.g., Mon 11/7/2005 03:49 PM). It shows up
fine as a column in the Deleted Items folder, but all what should be dates
say none.

All help will be appreciated.
 
S

Sue Mosher [MVP-Outlook]

A field can only show the data that field contains. Since Outlook doesn't stamp any date on an item when it is deleted, your field will always show nothing.

Populating the field with data would require a small amount of Outlook VBA code to be running to monitor the addition of new items to the Deleted Items folder. Let us know if you want to pursue that route.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
B

Ben M. Schorr - MVP

Creating a custom field doesn't really solve the problem since Outlook
doesn't know to put any data in it. Outlook doesn't track the date deleted
per se.

You might have more success using the Date Modified field; which should be
updated when the message is deleted.

--
Aloha,

-Ben-
Ben M. Schorr, OneNote-MVP
Roland Schorr & Tower
http://www.rolandschorr.com
Microsoft OneNote FAQ: http://www.factplace.com/onenotefaq.htm

**I apologize but I am unable to respond to direct requests for assistance.
Please post questions and replies here in the newsgroup. Mahalo!
 
S

Sue Mosher [MVP-Outlook]

It's pretty straightforward code, for the built-in ThisOutlookSession module in VBA:

Dim WithEvents colDelItems As Outlook.Items

Private Sub Application_Startup()
Dim ns As Outlook.NameSpace
Set ns = Application.GetNamespace("MAPI")
Set colDelItems = _
ns.GetDefaultFolder(olFolderDeletedItems).Items
Set ns = Nothing
End Sub

Private Sub colDelItems_ItemAdd(ByVal Item As Object)
Dim prop As Outlook.UserProperty
Set prop = Item.UserProperties.Add("Date Deleted", olDateTime, True)
prop.Value = Now
Item.Save
Set prop = Nothing
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Thanks. I've stumbled around the Visual Basic Editor but I think it's
beyound me. Can you tell me what to do?
 
S

Sue Mosher [MVP-Outlook]

Copy and paste the code into the ThisOutlookSession module. Make sure the Tools | Macro | Security level is set to Medium or Low. Restart Outlook.

If you're new to Outlook VBA macros, these web pages should help you get started:

http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Thank you. It works perfectly.

Sue Mosher said:
Copy and paste the code into the ThisOutlookSession module. Make sure the Tools | Macro | Security level is set to Medium or Low. Restart Outlook.

If you're new to Outlook VBA macros, these web pages should help you get started:

http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and 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