A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Inspector Bug/Question



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 7th 09, 04:44 AM posted to microsoft.public.outlook.program_vba
Addin_Noob[_2_]
external usenet poster
 
Posts: 4
Default Inspector Bug/Question

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  
Old April 7th 09, 09:07 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Inspector Bug/Question



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  
Old April 8th 09, 12:25 AM posted to microsoft.public.outlook.program_vba
Addin_Noob[_2_]
external usenet poster
 
Posts: 4
Default Inspector Bug/Question

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  
Old April 8th 09, 10:25 AM posted to microsoft.public.outlook.program_vba
Addin_Noob[_2_]
external usenet poster
 
Posts: 4
Default Inspector Bug/Question

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 02:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.