Item_Open and NewInspector events not triggered?

N

NilovSerge

Hallo!
I need opening my form(based on mailItem) and hide some standar
buttons(Reply,Replay all...)
and open my own toolbar with commandbuttons to make some task.
managed with showing/hiding toolbars
and commandbuttons on it. The problem is that opening creating a ne
mail or opening an existing one(my for
or standart mail) I not ALWAYS get event objContactItem_Open
I define if that is my form :
' Declaration of events objects
Dim myOlApp As New Outlook.Application
Private WithEvents olInboxItems As Items
Public WithEvents myOlExp As Outlook.Explorer
Public WithEvents myOlInspectors As Outlook.Inspectors
Public WithEvents objContactItem As Outlook.MailItem ' Object fo
Events of mailItem


Private Sub Application_Startup() ' Create Inspector object
Set myOlInspectors = myOlApp.Inspectors
...
End Sub


Private Sub myOlInspectors_NewInspector(ByVal Inspector A
Outlook.Inspector)
Dim TempObject As Object
On Error Resume Next
Inspector.WindowState = olMaximized ' Maximize the inspector

Set TempObject = Inspector.CurrentItem
If Not TypeOf TempObject Is Outlook.MailItem Then
Exit Sub ' If that is not a mailItem - hide toolbar wit
commandbars
End If
Set objContactItem = TempObject ' Create object of event ONLY fo
mailItems
End Sub ' This event very often not triggered!


Private Sub objContactItem_Open(Cancel As Boolean) ' This event ver
often not triggered!
Dim Item As Object
On Error Resume Next
If Not TypeOf objContactItem Is Outlook.MailItem Then
ShowDocSignToolBar (False) ' if this control comes to this functio
than ALL WRIGHT !
Exit Sub ' If that is not a mailItem - hide toolbar wit
commandbars
End If
...
end sub
...
I don't know why but events objContactItem_Open an
myOlInspectors_NewInspector very often are not triggered!
But as I understand these event must be triggered any time as I ope
new or existing mail. I set breakpoints
in these events but they not allways works. And as a result opening m
form very often I don't see my toolbar
and in simple mails I see my toolbar though I tried to hide it!
I use OutLook 2000 SP-(9.0.0.6627) russian version. What is wrong
 
K

Ken Slovak - [MVP - Outlook]

If you are using WordMail with Outlook 2000 then NewInspector and
various other event may not fire and are unreliable.
 

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