C
Carol Chisholm
This is related to an earlier post. (Thanks Ken for the help)
I want to open the next item in the inbox, starting at the currently
open item.
This code works when I have just started outlook, but sometimes gives
a "Error 13 Type Mismatch" on the Set olPop line.
It generally fails when I have been moving stuff around in the Inbox.
Dim oInbox As Outlook.MAPIFolder
Dim olApp As Application 'Outloook application
Dim olNameSpace As NameSpace
Set olApp = CreateObject("Outlook.Application")
Set olNameSpace = olApp.GetNamespace("MAPI")
Set oInbox = olNameSpace.GetDefaultFolder(olFolderInbox)
Set ActiveExplorer.CurrentFolder = oInbox
Set olPop = Application.ActiveInspector.CommandBars.FindControl(, 360)
Set olCmd = olPop.Controls(1)
I want to open the next item in the inbox, starting at the currently
open item.
This code works when I have just started outlook, but sometimes gives
a "Error 13 Type Mismatch" on the Set olPop line.
It generally fails when I have been moving stuff around in the Inbox.
Dim oInbox As Outlook.MAPIFolder
Dim olApp As Application 'Outloook application
Dim olNameSpace As NameSpace
Set olApp = CreateObject("Outlook.Application")
Set olNameSpace = olApp.GetNamespace("MAPI")
Set oInbox = olNameSpace.GetDefaultFolder(olFolderInbox)
Set ActiveExplorer.CurrentFolder = oInbox
Set olPop = Application.ActiveInspector.CommandBars.FindControl(, 360)
Set olCmd = olPop.Controls(1)