Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   add toolbar in inspector contact item (http://www.outlookbanter.com/outlook-vba/7505-add-toolbar-inspector-contact-item.html)

Irene February 24th 06 09:47 PM

add toolbar in inspector contact item
 
Hi,

I am using Outlook 2003.
Do I need a "inspector wrapper" if i create a toolbar in outlook vba?
below is my start, am i on the right track?

Private Sub Application_Startup()
Set colInspectors = Application.Inspectors
End Sub


Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)
' MsgBox "New Inspector"


Dim objItem As Object
Dim objinsp As Inspector
Set objinsp = Inspector
On Error Resume Next
Set objItem = objinsp.CurrentItem
Select Case objItem.Class
Case olContact
Set objContactItem = objItem
' MsgBox "contact"
' createtoolbar function

'End If
End Select
End Sub


Thanks

Ken Slovak - [MVP - Outlook] February 24th 06 10:23 PM

add toolbar in inspector contact item
 
You always need an Inspector wrapper if you want to handle button clicks in
more than one open Inspector. If there only ever is 1 Inspector open at a
time you don't need a wrapper. The wrapper handles not only the Inspector
object to help tell a COM addin when Outlook is closing but also lets each
wrapper class handle a button click without interfering with any other open
Inspector and its buttons.

You can use the sample at
http://www.slovaktech.com/code_sampl...spectorWrapper to get you
started. It's VB 6, so is code compatible with VBA. However you will not
need to use the tests for Inspectors.Count and Explorers.Count in the VBA or
to use a global Outlook object. Instead, just let Outlook close things down
when it wants to, and you use Application in Outlook VBA, an intrinsic
object.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Irene" wrote in message
...
Hi,

I am using Outlook 2003.
Do I need a "inspector wrapper" if i create a toolbar in outlook vba?
below is my start, am i on the right track?

Private Sub Application_Startup()
Set colInspectors = Application.Inspectors
End Sub


Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)
' MsgBox "New Inspector"


Dim objItem As Object
Dim objinsp As Inspector
Set objinsp = Inspector
On Error Resume Next
Set objItem = objinsp.CurrentItem
Select Case objItem.Class
Case olContact
Set objContactItem = objItem
' MsgBox "contact"
' createtoolbar function

'End If
End Select
End Sub


Thanks




All times are GMT +1. The time now is 09:17 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com