Hi
Can someone share code sample on how to check for a Toolbar and accordingly add a custom toolbar with buttons.
Thanks in advance
Hi
Can someone share code sample on how to check for a Toolbar and accordingly add a custom toolbar with buttons.
Thanks in advance
Hi there,
You might be able to use something like this, although I'm not sure what version you're working with...
[vba]Private Sub Application_Startup()
Dim olApp As Application, NS As NameSpace, olFld As Folder
Dim cbMenu As CommandBar, cmbNew As CommandBarButton
On Error Resume Next
Set olApp = Outlook.Application
Set NS = olApp.GetNamespace("MAPI")
Set olFld = NS.GetDefaultFolder(olFolderInbox)
olApp.ActiveExplorer.CurrentFolder = olFld
Set cbMenu = ActiveExplorer.CommandBars("Menu Bar")
'Menu Bar
'Standard
'Advanced
'Web
On Error Resume Next
Set cmbNew = cbMenu.Controls("Caption").Delete
On Error Resume Next
Set cmbNew = cbMenu.Controls.Add(msoControlButton)
With cmbNew
.Caption = "Caption"
.OnAction = "macroName"
.TooltipText = "toolTip"
.FaceId = "FaceId"
.Style = msoButtonIconAndCaption
.BeginGroup = True
End With
End Sub[/vba]
HTH
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables