Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba to open an email (simulate a double click)

Status
Not open for further replies.

lsman11

Programmer
Dec 22, 2004
18
US
Hi,

I am looking for some vba code to traverse through, lets say, my inbox folder, and open each email in there (similar to double clicking on each email), so that an outlook window pops up for each email... any ideas?

Any help appreciated. Thanks !
 
What have you tried so far ?
Note: hopefully you'll never be spammed ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim Item As Object

Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)

For Each Item In Inbox.Items
... (here is where lets say, i'd like to open each email)
Next Item

-----

If anything, can someone please point me at the correct API for VBA? I know that MailItems exist, perhaps i should be using those, but i do not know the methods i can use on those type of objects...

Thanks.
 
can someone please point me at the correct API for VBA
When in the VBE play with the F2 (Object browser) and F1 (Help) keys.

What about something like this ?
For Each Item In Inbox.Items
Item.Display
Next Item

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top