G
Gary
Hello,
I would like to know how I could trap or determine programmatically
when a user is reading an email message in the preview pane. In other
words, without double clicking a message, which normally opens an
inspector window to display that email message, I would like to
programmatically determine when a user is just reading the message in
the preview pane. Also, in Outlook 2000, when a user single clicks
another message, that message's body then appears in the preview pane
normally. Is there any event that can tell me when a user is
previewing a message? The closest event is the SelectionChange event
of the Explorer object.
I do know there is an event for the Explorer Object called
SelectionChange and that seems to work. I did a test by putting in a
message box inside this event and sure enough the message box came up
when I browsed to another message (clicked onto a message).
What I want to do is run a program when the user clicks the message. I
have a VB 6 COM Add-in program running perfectly when the user double
clicks a message that opens an inspector window (I declared and
instantiated an object variable of type MailItem that points to the
mail item when a new inspector window opens – code snippet given
below.). However, since an inspector window isn't being opened, I
can't use the same code. I am also only interested in emails in the
inbox when I run my program.
Private Sub oAppInspectors_NewInspector(ByVal Inspector As
Outlook.Inspector)
'When a new Inspector is opened
Set oAppInspector = Inspector
If oAppInspector.CurrentItem.Class = olMail Then 'only Mail items
Set oAppMail = oAppInspector.CurrentItem
End If
End Sub
I also have events for the object variable oAppMail such as Send,
Reply, and Read, which are also working great.
I guess what I am asking is how do you set an object variable of
MailItem type to the currently viewed email message in the preview
pane? Once I have that, I think I can use similar code to what I have
now. However, I don't think there is an active inspector window to use
so I am at loss.
Any help is most appreciated. Thanks.
I would like to know how I could trap or determine programmatically
when a user is reading an email message in the preview pane. In other
words, without double clicking a message, which normally opens an
inspector window to display that email message, I would like to
programmatically determine when a user is just reading the message in
the preview pane. Also, in Outlook 2000, when a user single clicks
another message, that message's body then appears in the preview pane
normally. Is there any event that can tell me when a user is
previewing a message? The closest event is the SelectionChange event
of the Explorer object.
I do know there is an event for the Explorer Object called
SelectionChange and that seems to work. I did a test by putting in a
message box inside this event and sure enough the message box came up
when I browsed to another message (clicked onto a message).
What I want to do is run a program when the user clicks the message. I
have a VB 6 COM Add-in program running perfectly when the user double
clicks a message that opens an inspector window (I declared and
instantiated an object variable of type MailItem that points to the
mail item when a new inspector window opens – code snippet given
below.). However, since an inspector window isn't being opened, I
can't use the same code. I am also only interested in emails in the
inbox when I run my program.
Private Sub oAppInspectors_NewInspector(ByVal Inspector As
Outlook.Inspector)
'When a new Inspector is opened
Set oAppInspector = Inspector
If oAppInspector.CurrentItem.Class = olMail Then 'only Mail items
Set oAppMail = oAppInspector.CurrentItem
End If
End Sub
I also have events for the object variable oAppMail such as Send,
Reply, and Read, which are also working great.
I guess what I am asking is how do you set an object variable of
MailItem type to the currently viewed email message in the preview
pane? Once I have that, I think I can use similar code to what I have
now. However, I don't think there is an active inspector window to use
so I am at loss.
Any help is most appreciated. Thanks.