Results 1 to 2 of 2
2009-07-15, 17:54 #1
- Join Date
- Jan 2001
- Melbourne, Australia
- Thanked 0 Times in 0 Posts
We're upgrading our document management system. An new issue occuring is duplicate Word menus are displaying eg File, Save...Save As
We have implemented work around code to remove the duplicate menu items.
However what's occuring is; the duplicate Save menu item is removed and accidentally removing the only save icon on the toolbar.
the code is accessing the command bar which relates to both menu bar and toolbars.
heres the code...
Set oCBB = LocateControl(CommandBars("File"), msoControlButton, "&Save", "DMSAVE", 1)
If Not oCBB Is Nothing Then
If oCBB.Visible = True Then
oCBB.Visible = False
Logging DBUG & oCBB.Caption & " button hidden", vbQuestion, sPROJ & PERIOD & sMODULE & PERIOD & sPROC
is there anyway code to access just menu items?
Resetting the Standard toolbar displays the save icon.
Another solution I may implement is resetting the standard toolbar after the code runs.
Does code exist to reset toolbars?
any other solutions I can implement?
2009-07-15, 19:12 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
LocateControl is not a built-in Word VBA procedure, so I don't know what it does.
You can hide the built-in File | Save menu item as follows:
CommandBars("File").Controls("Save").Visible = False
This shouldn't affect the Save button on the Standard toolbar. For the Save As menu item, use
CommandBars("File").Controls("Save As...").Visible = False
If you want to reset the Standard toolbar: