Iqbal Khan
New Member
- Outlook version
- Outlook 2013 64 bit
- Email Account
- POP3
Hi,
I am trying to identify the number of email messages opened by a user.
I am using "Application_ItemLoad" event to assign myitem as opened email message.
Private Sub Application_ItemLoad(ByVal item As Object)
If item.Class = olMail Then
Set myItem = item
End If
End Sub
With the above code the current item is assigned as myitem. I am triggering a data upload event when I close the mailitem. Hence the trigger happens only when the last email is closed and for the other email messages nothing happens.
Private Sub myItem_close(Cancel As Boolean)
Modupdata.uploadviewed (vtime)
msg.Close olDiscard
MsgBox "Data captured"
If EmailDetails.Visible = True Then
EmailDetails.Hide
End If
End If
End Sub
Please help.
Thanks
I am trying to identify the number of email messages opened by a user.
I am using "Application_ItemLoad" event to assign myitem as opened email message.
Private Sub Application_ItemLoad(ByVal item As Object)
If item.Class = olMail Then
Set myItem = item
End If
End Sub
With the above code the current item is assigned as myitem. I am triggering a data upload event when I close the mailitem. Hence the trigger happens only when the last email is closed and for the other email messages nothing happens.
Private Sub myItem_close(Cancel As Boolean)
Modupdata.uploadviewed (vtime)
msg.Close olDiscard
MsgBox "Data captured"
If EmailDetails.Visible = True Then
EmailDetails.Hide
End If
End If
End Sub
Please help.
Thanks