Article ID: 206713
Article Last Modified on 11/23/2006
Sub DisplayMailItem()
Dim ol As Outlook.Application
Dim olns As Outlook.NameSpace
Dim MyInbox As Outlook.MAPIFolder
Dim MyItems As Outlook.Items
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
' Set MyInbox to the user's default Inbox.
Set MyInbox = olns.GetDefaultFolder(olFolderInbox)
' Display the Inbox.
MyInbox.Display
' Set MyItems to the collection of items in the Inbox.
Set MyItems = MyInbox.Items
' Display the second item.
MyItems(2).Display
End Sub
After running this sample code to display an Outlook message, if you then
point to Next or Previous on the View menu, the commands will be
unavailable (dimmed).
146636 OL2000: Questions About Custom Forms and Outlook Solutions
Additional query words: OutSol OutSol2000 dim grey gray greyed grayed out disabled OL2K
Keywords: kbcode kbprb kbprogramming KB206713