I can't get a toolbar item to appear. I have thrown in some MsgBox entries and they are firing up OK. They show me that there are exactly the same number of ToolbarItems before the Add as after. Any ideas where I'm going wrong? Code follows.


Public Function CustomizeToolbar(sGWContext As String, objGWToolbar As Object) As Boolean
Dim Button As Object
Dim FilePath As String
If InStr(sGWContext, "GW.CLIENT") > 0 Then ' Check for GW.CLIENT or any sub context
MsgBox "Customising toolbar for " & sGWContext
Dim Cmd00 As New GWCommand ' Build GWCommand object
Let Cmd00.PersistentID = AccountEnquiryID ' Set persistent ID for GWCommand object
Let Cmd00.ToolTip = "Show the account details" ' Set Button tooltip
MsgBox "Nr items = " & objGWToolbar.Toolbaritems.Count
Set Button = objGWToolbar.Toolbaritems.Add("Account Enquiry", Cmd00) ' Add button to toolbar
MsgBox "Nr items = " & objGWToolbar.Toolbaritems.Count
FilePath = "c:\program files\pm\accountsenquiry.exe"
' BUTTON_1 can be replaced with the name of the bitmap contained in the .exe or .dll
Call Button.SetBitmap(FilePath, 0) ' set were the bitmap is found and its name
End If
CustomizeToolbar = False
End Function