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

add toolbar in inspector contact item



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 24th 06, 08:47 PM posted to microsoft.public.outlook.program_vba
Irene
external usenet poster
 
Posts: 3
Default 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
Ads
  #2  
Old February 24th 06, 09:23 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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


 




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
Help! Inspector.Close is fired before Inspector.Activate handler finishes Sergey Anchipolevsky Add-ins for Outlook 8 February 9th 06 09:51 AM
How to find out which is the current item shown in the inspector? Michael Reukauff Add-ins for Outlook 1 January 25th 06 02:33 PM
how to add commandbarbutton to inspector window Ram Outlook and VBA 0 January 19th 06 06:07 AM
how to add commandbarbutton to inspector window Ram Outlook - General Queries 1 January 18th 06 08:42 PM
how to add commandbarbutton to inspector window Ram Add-ins for Outlook 0 January 18th 06 03:18 PM


All times are GMT +1. The time now is 06:29 AM.


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