Article ID: 180974
Article Last Modified on 11/23/2006
Sub DisplayMailItem()
Dim ol As Outlook.Application
Dim olns As NameSpace
Dim MyInbox As Object
Dim MyItems As Object
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).
Additional query words: OutSol OutSol98 dim grey gray greyed grayed out disabled
Keywords: kbdswnet2003swept kbcode kbprb kbprogramming KB180974