S
Summer
This is what I am using to remove but in this instance it is not suitable -
it does not remove it? I use this in 2003/2007 - any help would be
appreciated to get "Style" TEXT removed from CommandBar would be
appreciated!
'If you want to remove the item from the menu, you can do it like this:
Sub RemoveDoStyles()
Dim cb As CommandBar
Dim ctl As CommandBarControl
CustomizationContext = NormalTemplate
Set cb = CommandBars("Text")
For Each ctl In cb.Controls
If ctl.Tag = "Style" Then
ctl.Delete
End If
Next
End Sub
This is the macro that puts the "Style" TEXT on the CommandBar?
Sub DoStyles()
Dim StyleCount As Integer
Dim J As Integer
Dim x As CommandBar, z As CommandBarComboBox
On Error Resume Next
StyleCount = ActiveDocument.Styles.count
Set x = CommandBars.Add("AllMyStyles", msoBarPopup)
Set z = x.Controls.Add(msoControlComboBox)
z.Caption = "Active Styles:"
For J = 1 To StyleCount
If ActiveDocument.Styles(J).InUse Then
z.AddItem ActiveDocument.Styles(J)
End If
Next J
z.Text = Selection.Style
x.ShowPopup
Selection.Style = z.List(z.ListIndex)
CommandBars("AllMyStyles").Delete
End Sub
it does not remove it? I use this in 2003/2007 - any help would be
appreciated to get "Style" TEXT removed from CommandBar would be
appreciated!
'If you want to remove the item from the menu, you can do it like this:
Sub RemoveDoStyles()
Dim cb As CommandBar
Dim ctl As CommandBarControl
CustomizationContext = NormalTemplate
Set cb = CommandBars("Text")
For Each ctl In cb.Controls
If ctl.Tag = "Style" Then
ctl.Delete
End If
Next
End Sub
This is the macro that puts the "Style" TEXT on the CommandBar?
Sub DoStyles()
Dim StyleCount As Integer
Dim J As Integer
Dim x As CommandBar, z As CommandBarComboBox
On Error Resume Next
StyleCount = ActiveDocument.Styles.count
Set x = CommandBars.Add("AllMyStyles", msoBarPopup)
Set z = x.Controls.Add(msoControlComboBox)
z.Caption = "Active Styles:"
For J = 1 To StyleCount
If ActiveDocument.Styles(J).InUse Then
z.AddItem ActiveDocument.Styles(J)
End If
Next J
z.Text = Selection.Style
x.ShowPopup
Selection.Style = z.List(z.ListIndex)
CommandBars("AllMyStyles").Delete
End Sub