View Single Post
  #4  
Old July 12th 07, 02:14 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Enable/Disable Commandbar buttons

Thanks in advance for what? Is there a question here or are you just showing
the code that works now?

--
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


"Bodo" wrote in message
...
Hi Ken,
I modified the sub to enable/dsable the buttons, which works fine now:

Private Sub SetCommandBarButton(ButtonID As OutlookMenuCmdId,
ButtonEnabled
As Boolean)
Dim ctrl As Office.CommandBarControl, cmdBar As Office.CommandBar

If Not moOL.ActiveExplorer Is Nothing Then
Set ctrl =
moOL.ActiveExplorer.CommandBars.ActiveMenuBar.Find Control(, ButtonID, ,
True,
True)
If Not ctrl Is Nothing Then
ctrl.Enabled = ButtonEnabled
End If

For Each cmdBar In moOL.ActiveExplorer.CommandBars
If Not cmdBar Is Nothing Then
'If cmdBar.Type = msoBarTypeMenuBar Then
Set ctrl = cmdBar.FindControl(, ButtonID, , True) '
Auflistung aller Controlls
If Not ctrl Is Nothing Then
ctrl.Enabled = ButtonEnabled
End If
End If
Next
End If

Set cmdBar = Nothing
Set ctrl = Nothing
End Sub


--
Thanks in advance
Bodo


Ads