A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Email as of type Outlook.MailItem



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 7th 06, 05:16 PM posted to microsoft.public.outlook.program_vba
css
external usenet poster
 
Posts: 1
Default 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  
Old August 8th 06, 05:35 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default 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  
Old August 10th 06, 04:57 PM posted to microsoft.public.outlook.program_vba
c_shah
external usenet poster
 
Posts: 2
Default 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  
Old August 11th 06, 05:55 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 07:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.