If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
create new field - deleted date
Hi!
I implemented this code - it's great - brilliant - thanks. It seems to run sporadically though. Even in one day, it tags the deleted date onto some outlook items, but not others. I've tried moving items back out into another folder and then putting them back into the deleted folder. Sometimes this works, especially one by one, but some items just don't pick up the tag and I don't see how they're any diferent from other items that do. I'm on Outlook 2003, Exhange Server 2003. I've expoerted and re-imported my certificates in case an update didn't like them. Maybe it's to do with priorities on the network? "Sue Mosher [MVP-Outlook]" wrote: Unfortunately, Outlook lets you do things in the UI that just don't work as you would logically expect them to. In particular, creating a field doesn't put data into it. Just because you name a field "Deleted," Outlook doesn't know *what* data to put into it. This code, however, will watch the Deleted Items folder for new items. When one arrives, it will add the Deleted property to that item and then set the value of that property to the current date/time. Dim WithEvents colDelItems As Outlook.Items Private Sub Application_Startup() Dim objNS As Outlook.NameSpace Set objNS = Application.GetNamespace("MAPI") Set colDelItems = objNS.GetDefaultFolder(olFolderDeletedItems).Items Set objNS = Nothing End Sub Private Sub colDelItems_ItemAdd(ByVal Item As Object) On Error Resume Next Set objField = Item.UserProperties.Add("Deleted", olDateTime) objField.Value = Now Item.Save Set objField = Nothing End Sub Add the code to the built-in ThisOutlookSession module in Outlook VBA and make sure your macro security is not set to High. LookOut has a Search button, not Find, but it sounds like you have some other search tool that might serve you just as well. BTW, if you don't want to manually empty the trash every week, set the Deleted Items folder to delete items older than 7 days whenever AutoArchive runs. I have AutoArchive set up to run every day and delete items in Deleted Items that are older than a week. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "stephanie" wrote in message ... But, hey: When I go to View/Current/Customize/Fields, I see a “New Field” button. That looks like exactly what I need. And I can give it a name, and define it as date/time. And it even appears as a field in whichever window I created it in. So what’s the point of a field with no data? What’s it for, if not for what I need? I think I might have Lookout: it’s a button with the OL clock and stuff and the word “Find” on it. Is that it? It even searches with a partial name. And I can conjure it up with a single keyboard command. But sorting by name works pretty well, too, since I DO empty the trash every week or so. So, in the meantime, what’s with the “new field” button? S "Sue Mosher [MVP-Outlook]" wrote: Actually the VBA code to stamp the deletion date onto your Deleted custom field on the item would be very easy to write, but not everyone wants to go that route. Let me know if you do. I don't know if you've tried it, but another option would be to use the regular Find feature on the Deleted Items folder to locate the item. Of course, you have to remember enough of what the item was about or who sent it, in order to have some text to search for. But if it's important enough to want to recover it from Deleted Items, that wouldn't be a problem. If you do this sort of search often, you might want to get the free Lookout search tool from Microsoft's web site. It's usually a lot faster to search all your folders, included Deleted Items, with Lookout than to search one folder using Outlook's built-in Find. Plus, the Lookout search box sits right on the Outlook toolbar, so you don't have to switch to some other folder before you can start searching. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "stephanie" wrote in message ... Thank you very much Sue. Actually, you have almost grasped the problem. Because some of the messages I receive are not junk to be discarded immediately, they may remain in my Inbox for several days while I research, convene meetings, or otherwise take action prior to deleting them. Accordingly, when I finally do delete them, they may slip down into the depths of several days’ worth of banana peels. Which is generally fine with me. But occasionally I determine that a deleted item must be recovered. And OL 2002 makes a very nice provision for that exigency. And this provision works perfectly if one deletes items in the same order in which they were received. But, as you by now have probably figured out, my responsibilities do not always allow for that. I had hoped that by sorting them by deletion date, that I could get some notion of how deep to plunge in after a deleted item. SO. Thank you for advising me that only someone of greater expertise than myself can accomplish this. That is good information. Stephanie "Sue Mosher [MVP-Outlook]" wrote: Outlook does not maintain that information automatically. You would have to write VBA code to monitor the Deleted Items folder for new items and, for each item added, set the value of the Deleted field. Why do you want to do this anyway? These are deleted items after all. Do you sort through your garbage can at home to distinguish yesterday's banana peels from today's? "stephanie" wrote in message ... W2K. Outlook 2002 SP3. I need to be able to sort deleted files by the date that each one was deleted. I have created a "Deleted" field in my Deleted Files folder. I have identified it as a "date/time." But I can't figure out how to define it. "None" is entered in this column for each item. Many thanks. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Design help, please | SillySally | Using Forms | 27 | March 6th, 2005 04:11 AM |
If I create a form with the wizard and later decide I need to add another field do I have to re-create the form? | Mister John Doe | Using Forms | 3 | January 2nd, 2005 06:17 AM |
Autonumber | Ally H. | General Discussion | 7 | August 27th, 2004 04:51 PM |
field manipulation | Steve | Running & Setting Up Queries | 2 | May 28th, 2004 03:12 PM |