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
|
|||
|
|||
Email as of type Outlook.MailItem
Outlook 2003
How to programmatically access e-mails in inbox, any users created folders inside inbox or sent items as of type outlook.MailItem Basically, I want to iterate through all the e-mails that are marked with the yellow flag (in inbox, sent items and any folders created inside the inbox) |
Ads |
#2
|
|||
|
|||
Email as of type Outlook.MailItem
Am Mon, 7 Aug 2006 09:16:02 -0700 schrieb css:
Sample for the Inbox: Dim Mail As Outlook.MailItem Dim Items As Outlook.MAPIFolder Dim obj as Object Set Items = Application.Session.GetDefaultFolder(olFolderInbox ).Items For Each obj In Items If TypeOf obj Is Outlook.MailItem Then Set Mail=obj ' check for the flag here End If Next For sent items you can also use GetDefaultFolder with the proper constant. A child folder of the Inbox e.g. would be, assuming you do have the Inbox already: Dim Folder as Outlook.Mapifolder Set Folder = Inbox.Folders("ChildName") -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Outlook 2003 How to programmatically access e-mails in inbox, any users created folders inside inbox or sent items as of type outlook.MailItem Basically, I want to iterate through all the e-mails that are marked with the yellow flag (in inbox, sent items and any folders created inside the inbox) |
#3
|
|||
|
|||
Email as of type Outlook.MailItem
Thanks you. Your approach works wery well.
I apologize I might have posted this multiple times. One more question, how to process subfolders created within the inbox? different user's will have folders created within the inbox and they all can have different names? Thanks in advance. |
#4
|
|||
|
|||
Email as of type Outlook.MailItem
Am 10 Aug 2006 08:57:47 -0700 schrieb c_shah:
You can also loop through the subfolder with: Dim Folder as Outlook.MapiFolder For Each Folder in Inbox.Folders .... Next -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Thanks you. Your approach works wery well. I apologize I might have posted this multiple times. One more question, how to process subfolders created within the inbox? different user's will have folders created within the inbox and they all can have different names? Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I type an email address, my computer no longer fills it in. Help | Joel | Outlook - Installation | 1 | August 3rd 06 06:11 PM |
Help - can't add "Item" (of type MailItem) using Attachments.Add() | [email protected] | Outlook and VBA | 1 | August 3rd 06 05:55 AM |
I type a name to send email but it puts it as a business fax not e | mc1 | Outlook - Using Contacts | 2 | May 6th 06 04:06 AM |
Email Address Type Ahead | [email protected] | Outlook - General Queries | 3 | April 29th 06 12:40 AM |
How can I create a MailItem that displays like a received MailItem ? | Clive | Outlook - Using Forms | 0 | February 27th 06 04:14 PM |