![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hopefully this isn't too confusing: When I click New-Appointment, this fires
the new inspector event. But when I refer to inspector.currentitem, it seems to refer to whichever email message is highlighted in the inbox rather than the new appointment. Heres a code snippet: Private Sub m_colInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) On Error Resume Next Dim objItem As Object Set objItem = Inspector.CurrentItem MsgBox objItem.Subject End Sub Any ideas why this happens? Sorry I'm still learning. -Tim |
#2
|
|||
|
|||
![]() How do you set m_colInspectors, and why do you think it doesn't refer to Inspector.CurrentItem? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Mon, 6 Apr 2009 20:44:01 -0700 schrieb Addin_Noob: Hopefully this isn't too confusing: When I click New-Appointment, this fires the new inspector event. But when I refer to inspector.currentitem, it seems to refer to whichever email message is highlighted in the inbox rather than the new appointment. Heres a code snippet: Private Sub m_colInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) On Error Resume Next Dim objItem As Object Set objItem = Inspector.CurrentItem MsgBox objItem.Subject End Sub Any ideas why this happens? Sorry I'm still learning. -Tim |
#3
|
|||
|
|||
![]()
Thank you for the quick reply,
I have m_colInspectors defined as follows: Dim WithEvents m_colInspectors As Outlook.Inspectors Private Sub Application_Startup() Set m_colInspectors = Application.Inspectors End Sub Private Sub m_colInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) On Error Resume Next Dim objItem As Object Set objItem = Inspector.CurrentItem MsgBox objItem.Subject End Sub Normally this displays the subject line for whatever mailitem I open. However, when I click New - Appointment, the message still pops up with the subject line of whatever was last selected... but only sometimes. Seems hit or miss. Please let me know what you think. -Tim "Michael Bauer [MVP - Outlook]" wrote: How do you set m_colInspectors, and why do you think it doesn't refer to Inspector.CurrentItem? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Mon, 6 Apr 2009 20:44:01 -0700 schrieb Addin_Noob: Hopefully this isn't too confusing: When I click New-Appointment, this fires the new inspector event. But when I refer to inspector.currentitem, it seems to refer to whichever email message is highlighted in the inbox rather than the new appointment. Heres a code snippet: Private Sub m_colInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) On Error Resume Next Dim objItem As Object Set objItem = Inspector.CurrentItem MsgBox objItem.Subject End Sub Any ideas why this happens? Sorry I'm still learning. -Tim |
#4
|
|||
|
|||
![]()
Mike,
I figured it out... Turned out that I had defines objItem as a mailitem and not an object. Since I had a pesky "On Error Resume Next" I wasn't getting a runtime error and it was defaulting to the last item avalible. I appreciate the support. Thanks. -Tim "Addin_Noob" wrote: Hopefully this isn't too confusing: When I click New-Appointment, this fires the new inspector event. But when I refer to inspector.currentitem, it seems to refer to whichever email message is highlighted in the inbox rather than the new appointment. Heres a code snippet: Private Sub m_colInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) On Error Resume Next Dim objItem As Object Set objItem = Inspector.CurrentItem MsgBox objItem.Subject End Sub Any ideas why this happens? Sorry I'm still learning. -Tim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Inspector wrapper and Inspector close not fireing | [email protected] | Add-ins for Outlook | 1 | June 20th 08 01:53 PM |
Inspector Wrapper | goran | Add-ins for Outlook | 15 | February 4th 08 10:42 AM |
c++ and New Inspector event | JahMic | Add-ins for Outlook | 2 | March 21st 07 02:25 PM |
Inspector outdated | DanielH | Outlook and VBA | 4 | May 4th 06 06:53 PM |
Help! Inspector.Close is fired before Inspector.Activate handler finishes | Sergey Anchipolevsky | Add-ins for Outlook | 8 | February 9th 06 09:51 AM |