Detecting selection of InBox

  • Thread starter Thread starter BartH
  • Start date Start date
B

BartH

I would like to detect if the user selects (i.e. switches to) the
inBox in VBA to perform an action if this is the case.

There doesn't seem to be an onChange event handler for the Application
object...

Any help highly valued.
BartH
 
Thanx Dmitri,

Outlook VBA-help gives me the example:

(needs to be put in a class module and Initialize_handler needs to be
called)

Dim myOlApp As Outlook.Application
Public WithEvents myOlExp As Outlook.Explorer

Public Sub Initialize_handler()
Set myOlExp = myOlApp.ActiveExplorer
End Sub

Private Sub myOlExp_FolderSwitch()
Select Case MyOlExp.CurrentFolder.Name
Case "Sales Contacts"
MyToolsMenu.Visible = True
Case Else
MyToolsMenu.Visible = False
End Select
End Sub

I've made a class module, but if I switch folders in Outlook nothing
happens; how (and where from) do I call Initialize_handler?

I'm actually working on a protection for the inBox, so I need to monitor
if someone triggers it and then start the login procedure.

(Sorry for perhaps being blonde ;-)
BartH
 
ThanX again Dmitri,

In the meanwhile I got everything going. In fact I didn't have to put
the folderswitch in a class module...

CU

BartH @ Nedcom IT
ø¿ø
 
Back
Top