Toggling menu item prompts template save.. how can i prevent this?

P

Paul Moloney

I've created two macros in one of the my templates,
"TurnOnToolbars" and "TurnOffToolbars" that respectively
toggle on and off the display of particular toolbars.

The macros are activated by two menu items, "Turn On
N365 Custom Toolbars" and "Turn Off N365 Custom Toolbars",
only one of which is displayed at any time; the display of
these menu items are also toggled on and off by the macros.
(For example, the "TurnOnToolbars" macro also hides the
"Turn On N365 Custom Toolbars" menu items, and
reveals the "Turn Off N365 Custom Toolbars" menu item.)

However, when a user uses these macros in a document
based on this template, and then attempts to save the
document, they are prompted to also save the template.
Do you know why this is happening?

(One of the macros is show below as an example)

Thanks,

P.

Sub TurnOnToolbars()
'Macro created July 9th 2003
'Displays the N365 Toolbars
CommandBars("N365 Macros").Visible = True
CommandBars("N365 RFP").Visible = True
CommandBars("N365 Styles").Visible = True
Dim cbr As CommandBarControl
Set cbr = CommandBars("Menu Bar").Controls("N365 Macros"). _
CommandBar.Controls("Turn On N365 Custom Toolbars")
cbr.Visible = False
Set cbr = CommandBars("Menu Bar").Controls("N365 Macros"). _
CommandBar.Controls("Turn Off N365 Custom Toolbars")
cbr.Visible = True
End Sub
 
W

Word Heretic

G'day (e-mail address removed) (Paul Moloney),

because you have modified the toolbars! It wants to save changes to
the toolbar - even if nothing was actually achieved by it.

I have a command in Heretic.dot called ToggleHITToolbars

the menu selection reads Toggle Heretical Interface

if std is show it removes it and any other toolbar without my prefix
and shows all the ones with my prefix

if std toolbar isnt showing I do the vv

Same functionality, no menu customizations


(e-mail address removed) (Paul Moloney) was spinning this yarn:
I've created two macros in one of the my templates,
"TurnOnToolbars" and "TurnOffToolbars" that respectively
toggle on and off the display of particular toolbars.

The macros are activated by two menu items, "Turn On
N365 Custom Toolbars" and "Turn Off N365 Custom Toolbars",
only one of which is displayed at any time; the display of
these menu items are also toggled on and off by the macros.
(For example, the "TurnOnToolbars" macro also hides the
"Turn On N365 Custom Toolbars" menu items, and
reveals the "Turn Off N365 Custom Toolbars" menu item.)

However, when a user uses these macros in a document
based on this template, and then attempts to save the
document, they are prompted to also save the template.
Do you know why this is happening?

(One of the macros is show below as an example)

Thanks,

P.

Sub TurnOnToolbars()
'Macro created July 9th 2003
'Displays the N365 Toolbars
CommandBars("N365 Macros").Visible = True
CommandBars("N365 RFP").Visible = True
CommandBars("N365 Styles").Visible = True
Dim cbr As CommandBarControl
Set cbr = CommandBars("Menu Bar").Controls("N365 Macros"). _
CommandBar.Controls("Turn On N365 Custom Toolbars")
cbr.Visible = False
Set cbr = CommandBars("Menu Bar").Controls("N365 Macros"). _
CommandBar.Controls("Turn Off N365 Custom Toolbars")
cbr.Visible = True
End Sub

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email: (e-mail address removed)
Products: http://www.geocities.com/word_heretic/products.html
Spellbooks: 728 pages of dump left and dropping...

The VBA Beginner's Spellbook: For all VBA users.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top