views:

6

answers:

1

Hi,

In Excel 2003 I can access the collection Application.CommandBars to create custom toolbars using VBA. Is there an equivalent in Outlook 2003?

I am trying to change the labels on buttons of a customer toolbar. In the future I'd like to create the toolbar from scratch.

Cheers, Dave

--Trindaz on Fedang #Outlook-vbas

A: 

Ended up solving this one myself. Here's the code if you're interested:

Dim expExplorer As Outlook.Explorer
Dim cmbCommandBar As CommandBar
Dim ctlBarControl As CommandBarControl
For Each expExplorer In Outlook.Explorers
    For Each cmbCommandBar In expExplorer.CommandBars
        If cmbCommandBar.Name = "name-of-toolbar" Then
            For Each ctlBarControl In cmbCommandBar.Controls
                If ctlBarControl.Caption = "caption-i-want-to-change" Then
                    ctlBarControl.Caption = "new-caption-text"
                End If
            Next ctlBarControl
        End If
    Next cmbCommandBar
Next expExplorer
Trindaz