B
Bob Smith
Is there a way to forcefully hide or remove a button from an outlook add-in.
We still want the
add-in functional, just not the button on the tool bar in certain
situations. The vendor will not release the
source or make this feature enchancement for us.
I can do this with other buttons (below is the code to move the "Send and
Recieve" button). Whey I try it for this particular add-in button I get
"Run-time error '-2147467259 (8000405)': Method 'Visable' of the object
'_CommandBarButton' failed"
Dim standardBar As Office.CommandBar
Set moOL = Application
Dim count As Integer
Dim Index As Integer
count = moOL.ActiveExplorer.CommandBars.count
For Index = 1 To count
If "Standard" = moOL.ActiveExplorer.CommandBars.Item(Index).Name Then
Set standardBar = moOL.ActiveExplorer.CommandBars.Item(Index)
End If
Next Index
count = standardBar.Controls.count
For Index = 1 To count
If standardBar.Controls.Item(Index).Caption = "Send/Re&ceive" Then
standardBar.Controls.Item(Index).Visible = False
MsgBox "Hidden"
standardBar.Controls.Item(Index).Visible = True
MsgBox "Visible"
End If
Next Index
We still want the
add-in functional, just not the button on the tool bar in certain
situations. The vendor will not release the
source or make this feature enchancement for us.
I can do this with other buttons (below is the code to move the "Send and
Recieve" button). Whey I try it for this particular add-in button I get
"Run-time error '-2147467259 (8000405)': Method 'Visable' of the object
'_CommandBarButton' failed"
Dim standardBar As Office.CommandBar
Set moOL = Application
Dim count As Integer
Dim Index As Integer
count = moOL.ActiveExplorer.CommandBars.count
For Index = 1 To count
If "Standard" = moOL.ActiveExplorer.CommandBars.Item(Index).Name Then
Set standardBar = moOL.ActiveExplorer.CommandBars.Item(Index)
End If
Next Index
count = standardBar.Controls.count
For Index = 1 To count
If standardBar.Controls.Item(Index).Caption = "Send/Re&ceive" Then
standardBar.Controls.Item(Index).Visible = False
MsgBox "Hidden"
standardBar.Controls.Item(Index).Visible = True
MsgBox "Visible"
End If
Next Index