Opening next item in Inbox.

Y

Yaz

I am working on a macro that does some processing on the current (open)
email and then I would like to automatically open the next item in the inbox
(kind of like the "next item" icon on the Email form).

The only method I found was the GetNext method on the Items collection, but
GetNext always some other email, not the next item in the inbox. I even
tried sorting the Items using the same sort as Inbox (date), but it still
gets the same emails on GetNext.

I don't know how to do this, please help.

Thanks in advance.

Yasmeen
 
M

Michael Bauer

Hi Yasmeen,

you can use the CommandBars. Example:

Sub SelectNextItem()
Dim oCmd As Office.CommandBarButton
Dim oPop As Office.CommandBarPopup
Set oPop = Application.ActiveInspector.CommandBars.FindControl(, 360)
Set oCmd = oPop.Controls(1)
oCmd.Execute
End Sub

For selecting the previous item please use FindControl with id=359
instead of 360.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top