A
Al
Hi All,
I have the following code which is in a template in the startup folder.
It adds a button to the word command bar.
For some damn reason the actual text on the button is not displaying.
Anyone see why? I am in Office 2003.
Cheers
-Al
Sub Autoexec()
'install the button
Dim ctl As Office.CommandBarControl 'where the button will be
Dim ctlButton As Office.CommandBarButton
'before adding the button, verify if it is already installed ...
Set ctl =
CommandBars("standard").Controls(CommandBars("standard").Controls.Count)
If ctl.Caption <> "Caption Summary" Then
Set ctlButton = CommandBars("Standard").Controls.Add
With ctlButton
.Caption = "Caption Summary"
.TooltipText = "Click to start an arrest file set"
.OnAction = "Modification" 'the procedure to be call when a
click ...
End With
Else
'we are adding nothing to the toolBar, it is already here
End If
End Sub
Private Sub Modification() 'the sub where you handle the click event on the
Button
MsgBox "It works"
End Sub
I have the following code which is in a template in the startup folder.
It adds a button to the word command bar.
For some damn reason the actual text on the button is not displaying.
Anyone see why? I am in Office 2003.
Cheers
-Al
Sub Autoexec()
'install the button
Dim ctl As Office.CommandBarControl 'where the button will be
Dim ctlButton As Office.CommandBarButton
'before adding the button, verify if it is already installed ...
Set ctl =
CommandBars("standard").Controls(CommandBars("standard").Controls.Count)
If ctl.Caption <> "Caption Summary" Then
Set ctlButton = CommandBars("Standard").Controls.Add
With ctlButton
.Caption = "Caption Summary"
.TooltipText = "Click to start an arrest file set"
.OnAction = "Modification" 'the procedure to be call when a
click ...
End With
Else
'we are adding nothing to the toolBar, it is already here
End If
End Sub
Private Sub Modification() 'the sub where you handle the click event on the
Button
MsgBox "It works"
End Sub