H
Howard Kaikow
Using Word 2003.
For a CommandBar, the Top property means "For docked command bars, this
property returns or sets the distance from the command bar to the top of the
docking area".
Running code structured as follows, the two command bars are created, as
desired, each on a separate row at the bottom of the window.
However, after saving and closing the template, both toolbars appear on the
same row.
Anybody got an explanation?
lngCommandBarBottomHeight = 0
Set cmdbar = appWord.CommandBars.Add(Name:="First",
Position:=msoBarBottom, Temporary:=False, MenuBar:=False)
With cmdbar
.Visible = True
.Top = lngCommandBarBottomHeight
lngCommandBarBottomHeight = lngCommandBarBottomHeight + .Height
End With
' Create controls for First command bar here
Set cmdbar = appWord.CommandBars.Add(Name:="Second",
Position:=msoBarBottom, Temporary:=False, MenuBar:=False)
With cmdbar
.Visible = True
.Top = lngCommandBarBottomHeight
lngCommandBarBottomHeight = lngCommandBarBottomHeight + .Height
End With
' Create controls for Second command bar here
For a CommandBar, the Top property means "For docked command bars, this
property returns or sets the distance from the command bar to the top of the
docking area".
Running code structured as follows, the two command bars are created, as
desired, each on a separate row at the bottom of the window.
However, after saving and closing the template, both toolbars appear on the
same row.
Anybody got an explanation?
lngCommandBarBottomHeight = 0
Set cmdbar = appWord.CommandBars.Add(Name:="First",
Position:=msoBarBottom, Temporary:=False, MenuBar:=False)
With cmdbar
.Visible = True
.Top = lngCommandBarBottomHeight
lngCommandBarBottomHeight = lngCommandBarBottomHeight + .Height
End With
' Create controls for First command bar here
Set cmdbar = appWord.CommandBars.Add(Name:="Second",
Position:=msoBarBottom, Temporary:=False, MenuBar:=False)
With cmdbar
.Visible = True
.Top = lngCommandBarBottomHeight
lngCommandBarBottomHeight = lngCommandBarBottomHeight + .Height
End With
' Create controls for Second command bar here