![]() |
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 |
#6
|
|||
|
|||
![]()
when I used Items.Sort("[ReceivedTime]", True), I got a compile error. It
turns out that my Outlook gets mad when I use the ( )'s. aslo, I could not find Item_add in any microsoft support files. hmm, does Eric have his own coding language? I have 2003 so I can't see why there would be differences in our Outlooks. I havn't ever used a Module but I imagine I could learn it in 5 days or less like I did forms and Outlooksessions. Trapping them would be a good thing for me though. How would that work? I'll start researching Modules and how to code them while I await your responce. Thanks ~Brian "Eric Legault [MVP - Outlook]" wrote: Your code should work - good job! Note that setting myMailItem doesn't select anything - you are merely getting a handle to the object. There is also on way with Outlook programming to select anything - that's always up to the user. If you want to trap e-mails as they arrive, check out Item_Add in VBA help. This is an event for an Items collection that you get for a specific MAPIFolder. So if you want to trap e-mails that come into your Inbox, get that MAPIFolder object, then get the Items collection, then set a module level variable using the With Events keyword for that Items collection. Ping me if you want to do it this way and need more help. Otherwise, to get a handle to e-mails that already exist - and not worrying about trapping them as they arrive - use Items.Sort("[ReceivedTime]", True). That *should* put the newest item at the first position within the collection. As for getting messages by certain properties, such as Unread or FlagRequest, use Items.Restrict("[PROPERTYNAME] = 'PROPERTY VALUE'") to filter the collection. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
senderemailaddress | marco | Outlook and VBA | 1 | June 7th 07 01:20 PM |
SenderEmailAddress in VB.NET on Outlook 2003 | [email protected] | Add-ins for Outlook | 1 | April 10th 07 04:27 PM |
How to change read only SenderName and SenderEmailAddress | [email protected] | Outlook - General Queries | 3 | April 19th 06 08:22 PM |