![]() |
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 | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have the following code sample in ThisOutLookSession and when I set a
breakpoint and step through the code, it does show the correct number of items in Deleted Items folder - but does not delete them, no errors either Sub CustomMailMessageRule (Item as Mailitem) ' at the very end of it, this is called Call DeleteAllMailNotReceivedToday End Sub Sub DeleteAllMailNotReceivedToday() Dim DL as outlook.items Dim Om as Mailitem Dim i as integer set DL = application.getnamespace("MAPI").getdefaultfolder( olfolderdeleteditems).items for i = DL.Count to 1 step -1 set Om = DL.Item(i) if datediff("h",Om.receivedtime, now()) 24 then Om.Delete next set DL = nothing set Om = nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
sample code for empty deleted items folder | Tom[_7_] | Outlook and VBA | 3 | September 4th 08 04:00 PM |
Trying to find sample code for import from Excel | Dale Bennett | Outlook - Using Forms | 0 | October 11th 07 07:17 PM |
What are the correct Dim statements to go with this Microsoft Sample Code? | Bill | Outlook and VBA | 4 | April 27th 07 08:08 PM |
Sample Code for Merge With Attachments? | LongWayFromHome | Outlook and VBA | 13 | August 18th 06 05:04 PM |
Junk E-mail folder - is there a way to create a rule to delete items in this folder older than X days? | Jaycee | Outlook - General Queries | 1 | February 22nd 06 04:54 PM |