B
Birgit
Hi all,
I want to create a button on a custum toolbar that will allow the user to
use a style or autotext in the document. I know how to do this by hand, but
I want to do this now using VBA. The button is not supposed to call a macro
(as I do not want the template to contain macro's).
Any pointers?
This is what I have, but the button sadly does nothing... (ultimately I will
use customizationcontext to attach the toolbar to the right document)
Dim mybar As CommandBar
Dim mycontrol As CommandBarButton
Set mybar = activedocument.CommandBars.Add("mydoc")
Set mycontrol = mybar.Controls.Add(Type:=msoControlButton)
With mycontrol
.Caption = "Normal"
.Parameter = "normal"
.Style = msoButtonCaption
End With
I want to create a button on a custum toolbar that will allow the user to
use a style or autotext in the document. I know how to do this by hand, but
I want to do this now using VBA. The button is not supposed to call a macro
(as I do not want the template to contain macro's).
Any pointers?
This is what I have, but the button sadly does nothing... (ultimately I will
use customizationcontext to attach the toolbar to the right document)
Dim mybar As CommandBar
Dim mycontrol As CommandBarButton
Set mybar = activedocument.CommandBars.Add("mydoc")
Set mycontrol = mybar.Controls.Add(Type:=msoControlButton)
With mycontrol
.Caption = "Normal"
.Parameter = "normal"
.Style = msoButtonCaption
End With