Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / April 2004

Tip: Looking for answers? Try searching our database.

Inspector wrap...still having problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephane Gendron - 02 Apr 2004 15:12 GMT
Hi,

I recently add an inspector wrap to my Com add-in to correct a problem.

My problem was that my toolbar was only working on the latest inspector.

This problem is almost fix. Now my buttons works but my listbox doesn't
works...

I have 2 listbox and when you choose an item in the first listbox the sub
change of my listbox is not fire up. I fill the second listbox In the change
sub of the first listbox.

There is no event on the second listbox.

Anyboby have an idea??

Steph
Ken Slovak - [MVP - Outlook] - 02 Apr 2004 16:19 GMT
Be more specific. Where are those listboxes? Are they on Outlook forms or a
VB form or what? Did you change any binding on those controls if they are on
Outlook forms?

Signature

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

> Hi,
>
[quoted text clipped - 14 lines]
>
> Steph
Stephane Gendron - 05 Apr 2004 15:40 GMT
I make a mistake...I write that I use listboxes....but I use comboboxes.

Here is more details

The combobox are place on a outlook forms.

Here is the code I use to create the toolbar on creation of a new inspector

Private Sub colInsp_NewInspector(ByVal Inspector As Outlook.Inspector)
On Error GoTo ERRH_colInsp_NewInspector
Dim objToolBar As CommandBar
Dim cbClient As CommandBarComboBox
Dim strSub As String
Dim sngStep As Single
'----------------------------
strSub = strModule & "colInsp_NewInspector"

   AddInsp Inspector
   Err.Clear
   On Error Resume Next
   Set objToolBar = Inspector.CommandBars.Item("PlombcoAssocieClient")
   If Err.Number = "" Then
       objToolBar.Delete
   End If
   Err.Clear
   On Error GoTo ERRH_colInsp_NewInspector

   Set objToolBar = Inspector.CommandBars.Add("PlombcoAssocieClient",
msoBarTop, , False)

   '*********************************************************
   '  CREATION OF THE FIRST COMBOBOX
   '*********************************************************
   Set objCBCBClient = objToolBar.Controls.Add(Type:=msoControlComboBox)
   objCBCBClient.Tag = "Client"
   ' Ajouter la liste de Client dans le ComboBox
   RemplirComboBox objCBCBClient
   objCBCBClient.Width = 300
   objCBCBClient.OnAction = "<!" & gstrProgID & ">"
   objCBCBClient.Caption = "Client"

   '*********************************************************
   '  CREATION OF THE SECOND COMBOBOX
   '*********************************************************
   ' Ajouter la liste de contact des clients
   Set cbClient = objToolBar.Controls.Add(Type:=msoControlComboBox)
   cbClient.Tag = "Contact"
   cbClient.Width = 300
   'cbClient.OnAction = "" '******** THERE IS NO ACTION FOR THIS COMBOBOX
   cbClient.Caption = "Contact"

   '*********************************************************
   '  CREATION OF THE FIRST BUTTON...THERE IS NO PROBLEM
   '*********************************************************
   ' Ajouter le bouton Associer et Deplacer
   Set objCBBAssocier = objToolBar.Controls.Add(Type:=msoControlButton)
   objCBBAssocier.Tag = "Associer"
   objCBBAssocier.Caption = "Associer et d?placer"
   objCBBAssocier.OnAction = "<!" & gstrProgID & ">"
   objCBBAssocier.ToolTipText = "Associer l'item ? un contact"

   '*********************************************************
   '  CREATION OF THE SECOND BUTTON...THERE IS NO PROBLEM
   '*********************************************************
   ' Ajouter le bouton qui permet de remettre a zero les Combobox
   Set objCBBInitialiser = objToolBar.Controls.Add(Type:=msoControlButton)
   objCBBInitialiser.Tag = "Initialiser"
   objCBBInitialiser.Caption = "R?-initialiser"
   objCBBInitialiser.OnAction = "<!" & gstrProgID & ">"
   'btnAssocier.OnAction = strProjet & "InitialiserContact"
   objCBBInitialiser.ToolTipText = "Initialiser les 2 listes"

   ' Initialiser les listes de choix
   objCBCBClient.Text = ""
   cbClient.Text = ""
   objToolBar.Position = msoBarTop
   objToolBar.Visible = True
'----------------------------
exit_colInsp_NewInspector:
   Set cbClient = Nothing
   Set objToolBar = Nothing
   Exit Sub

ERRH_colInsp_NewInspector:
   Call HandleError(Err.Number, Err.Description, 1, strSub, sngStep, False)
   Resume exit_colInsp_NewInspector
End Sub

> Be more specific. Where are those listboxes? Are they on Outlook forms or a
> VB form or what? Did you change any binding on those controls if they are on
[quoted text clipped - 19 lines]
> >
> > Steph
Ken Slovak - [MVP - Outlook] - 05 Apr 2004 18:17 GMT
Err.Number is not a string. It's a numeric value. You should first of all
try to find an existing button, control or toolbar by assigning it to an
appropriate object and then delete it if it exists. Second, always use
.OnAction if you want to handle any events for whatever you added. Third,
always use a unique .Tag property for each object you add or you will
receive multiple event firings each time the object is clicked.

Combo's in Outlook CommandBars are problematical. Some people have gotten
them to work but most people have found they don't work correctly in Outlook
even if they do in other Office applications.

Signature

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

> I make a mistake...I write that I use listboxes....but I use comboboxes.
>
[quoted text clipped - 83 lines]
>     Resume exit_colInsp_NewInspector
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.