Showing results for 
Search instead for 
Do you mean 

Add a button to opportunity menu bar

Tuned Listener
Posts: 17
Country: France

Add a button to opportunity menu bar



I just want to add a button to opportunity menu bar, on opportunity and lookup tab. 

Is it possible?


I know how to add a button to contact menubar but it seems to does'nt work for Opportunity.



Bronze Super Contributor
Posts: 1,284
Country: USA

Re: Add a button to opportunity menu bar



Here is a routin to add a toolbar item into the ACT UI



 Public Shared Sub AddToolBarItem(ByVal ToolbarName As String, _
                                     ByVal urn As String, _
                                     ByVal MenuText As String, _
                                     ByVal Handler As Act.UI.CommandHandler, _
                                     ByVal InvImageLg As System.Drawing.Image, _
                                     ByVal InvImageSm As System.Drawing.Image, _
                                     ByVal Position As Integer, _
                                     ByVal HasSeperator As Boolean, _
                                     ByVal ACTAPP As Act.UI.ActApplication)


            Dim ToolTip As String = MenuText

            Dim NewToolBarItem As Act.UI.Core.CommandBarButton = New Act.UI.Core.CommandBarButton(ToolTip, _
                                                                                                  ToolTip, _
                                                                                                  Nothing, _
                                                                                                  urn, _
                                                                                                  InvImageLg, _

            NewToolBarItem.DisplayStyle = Act.UI.Core.CommandBarControl.ItemDisplayStyle.ImageOnly

            ' Remove the current toolbar
            RemoveToolBarItem(urn, ACTAPP)

            ' Register the command in ACT
            ACTAPP.RegisterCommand(urn, Handler, Act.UI.RegisterType.Shell)

            ' Add to all the toolbars available
            Dim tBar As Act.UI.Core.CommandBar
            For Each tBar In ACTAPP.Explorer.CommandBarCollection
                ' Only add to toolbar ( Not Menus )
                If tBar.Name.ToUpper().IndexOf("TOOLBAR") <> -1 Then
                    If tBar.Name.ToUpper() = ToolbarName Then
                        NewToolBarItem.IsVisible = False
                        NewToolBarItem.IsVisible = True
                        Exit For
                    End If
                End If

        Catch ex As Exception
            Throw New Exception("ACTAPPFunctions:AddToolBarItem", ex)
        End Try

    End Sub




AddToolBarItem("Opportunity Detail Toolbar", _
              Me.URN_OPPCon_ToolBar, _
              "Convert to Project", _
              "Convert to Project in a custom table.", _
              ACTConvertImage, _
              ACTConvertImage, _
              Me.HostApplication, _
              True, _


Hope this helps

-- Jim Durkin