Article ID: 171109
Article Last Modified on 2/12/2007
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
When you run this sample code to display an Outlook message, the Previous
and Next buttons on the message's toolbar do not function, and if you click
Previous or Next on the View menu, no choices are available.
Additional query words: OutSol OutSol97
Keywords: kbprb kbprogramming KB171109