Inspector Bug/Question

Status
Not open for further replies.
Q

QWRkaW5fTm9vYg

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
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
How do you set m_colInspectors, and why do you think it doesn't refer to

Inspector.CurrentItem?

Best regards

Michael Bauer

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
 
Q

QWRkaW5fTm9vYg

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 " wrote:



> How do you set m_colInspectors, and why do you think it doesn't refer to
> Inspector.CurrentItem?

> > Best regards
> Michael Bauer

> > >

> 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

>
 
Q

QWRkaW5fTm9vYg

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
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Outlook 2010 How could I globally redesign an outlook template form/region/inspector template used to display mail lists or an individual mails? Outlook VBA and Custom Forms 0
B Auto Preview Attachment in Inspector Reading Pane Outlook VBA and Custom Forms 1
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
T New Inspector word editor crash Outlook 2003 Outlook VBA and Custom Forms 3
A running code after the new inspector is visible Outlook VBA and Custom Forms 1
N Modal form is not properly working on inspector Outlook VBA and Custom Forms 10
K add a designed group into a existing inspector ribbon Outlook VBA and Custom Forms 7
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
T How to get Inspector object from Window handle Outlook VBA and Custom Forms 2
K Get Inspector Ptr In Outlook 2007. Outlook VBA and Custom Forms 3
T How to get Inspector or MailItem from wordEditor Outlook VBA and Custom Forms 6
S PR_MESSAGEFLAGS & Compose/Read - Inspector Outlook VBA and Custom Forms 4
S Error 287 on Inspector.Close() Outlook VBA and Custom Forms 4
K Buttons are added multiple times in New Inspector window Outlook VBA and Custom Forms 4
V How to find mailitem in the inspector is a brand new one Outlook VBA and Custom Forms 2
A active inspector in memory Outlook VBA and Custom Forms 1
B How to get the path from an outlook.Inspector Outlook VBA and Custom Forms 4
M How to get active inspector window handle? Outlook VBA and Custom Forms 3
A disable a menu in active inspector Outlook VBA and Custom Forms 1
S inspector toolbar buttons get multiple events Outlook VBA and Custom Forms 3
S Quick access toolbar in inspector window Outlook VBA and Custom Forms 3
T Using Ribbon in Inspector window Outlook VBA and Custom Forms 2
P Inspector.WordEditor always returns null Outlook VBA and Custom Forms 3
Z Inspector.CurrentItem causes Shared Calendar Issue Outlook VBA and Custom Forms 5
E Outlook 2016 Inbox search bug Using Outlook 1
C address book "when sending email" bug? Using Outlook 0
Diane Poremsky iPhone and the Meeting Request Bug Using Outlook 0
Diane Poremsky Outlook Connector Contact Sync Bug (Fixed) Using Outlook 0
Diane Poremsky Add to Outlook Contacts Bug (Fixed) Using Outlook 1
TheDavidSlight Daylight savings - another subtle bug ... Using Outlook 3
R A bug in calendar form? Using Outlook 2
P BCM 2013 Contacts Form Drop Down Box Bug BCM (Business Contact Manager) 1
W Midnight bug - Outlook Today & reminders Using Outlook 5
witzker Outlook bug when creating a user defined contact form? Using Outlook 1
mrje1 Assigned Categories keep getting deleted in mail, bug? How to fix if possible? Using Outlook 5
P connector categories bug Using Outlook.com accounts in Outlook 2
J bug in converting eml files of wlm on import to outlook 2010 Using Outlook 7
R Proof Of Looping Bug in Reading Outlook Inbox From Access? Outlook VBA and Custom Forms 2
A Outlook-Exchange bug??? Outlook VBA and Custom Forms 8
J Exchange 2010 and Outlook 2007 folder bug Exchange Server Administration 12
C Attachments collection bug ? Outlook VBA and Custom Forms 5
Q Outlook 2007 Add-in Bug with with Exchange - Long explanation Outlook VBA and Custom Forms 2
O Newbie question: how to sync two Outlook -Exchange and IMAP- calendars? Using Outlook 4
D a general question re how backup programs handle pst files ... I have no problems, just curious Using Outlook 1
e_a_g_l_e_p_i A few question before I decide to switch to Pop from imap Using Outlook 9
D.Moore SendAndReceive question Outlook VBA and Custom Forms 2
J Transport Rule to detect Keyword question.. Exchange Server Administration 2
N Question Using Outlook 8
D Shared Mailbox question Exchange Server Administration 1

Similar threads

Top