Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Disable customization of command bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gina - 03 Nov 2005 15:10 GMT
Hi all.

What I am trying to do is to disable the appearing of point ' customize'
when right-clicking on the only commandbar
all is hidden but still on right-clicking the 'invoice' command bar there is
the option of customization ...

here's my code:

Dim i As Integer
i = 1

   Application.WindowState = wdWindowStateNormal

   While i < ActiveDocument.CommandBars.Count - 1

       If ActiveDocument.CommandBars(i).Name <> "Invoice" Then
           ActiveDocument.CommandBars(i).Enabled = False
       Else
           ActiveDocument.CommandBars(i).Enabled = True
       End If

       Debug.Print i
       i = i + 1
   Wend

   CommandBars("Invoice").Enabled = True
   CommandBars.AdaptiveMenus = False

Any help and idea would be highly appreciated !!
Thx, Gina
Tony Jollans - 03 Nov 2005 16:36 GMT
Try using Commandbars.DisableCustomize = True

--
Enjoy,
Tony

> Hi all.
>
[quoted text clipped - 27 lines]
> Any help and idea would be highly appreciated !!
> Thx, Gina
Gina - 04 Nov 2005 10:56 GMT
Thanks Tony,

unfortunately is, what you suggested not an option ... at least not in my
version 2000
further to this there have come up more serious problems with my idea of
disabling everything .... all toolbars get disabled even in normal.dot
this is unacceptable and that wasn't what I intended to do.

please see customization.menuestoolbars for more

Gina
> Try using Commandbars.DisableCustomize = True
>
[quoted text clipped - 34 lines]
> > Any help and idea would be highly appreciated !!
> > Thx, Gina
Tony Jollans - 04 Nov 2005 13:50 GMT
Sorry, you are correct - DisableCustomize is not in 2000. Without it I don't
think you can completely stop user customization.

I have had a quick look at your other thread and will study it later. What
you want is just about achievable but is a lot of work and not 100%
effective (users can open documents without running macros if they want, for
example). It also requires a lot more than just disabling toolbars; there
are all the shortcut key combinations to deal with as well.

--
Enjoy,
Tony

> Thanks Tony,
>
[quoted text clipped - 46 lines]
> > > Any help and idea would be highly appreciated !!
> > > Thx, Gina
Gina - 04 Nov 2005 15:51 GMT
Thanks Tony ....

oh ... such a pity ...
basically the main thing I would want is the right-click on the remaining
toolbar 'Invoice' - the customization !!!
... where they can get what they want
there is no'right-click' anymore nowhere in the doc created from
Invoice1.dot .... but still with the remaining toolbar .... oh dear

I changed my code so normal.dot and any doc created from it and from any
other *.dot apart from the Invoice1.dot aren't anymore affected ....so far
so good but all the points you made have not been addressed yet...

I am really looking forward to your ideas, please !!!

Gina

***
Sub HideAllToolbars()
Dim i As Integer
i = 1

   Application.WindowState = wdWindowStateNormal

   If ActiveDocument.AttachedTemplate = "Invoice1.dot" Then
       If ActiveWindow.Active = True Then

           Do
               If Not (ActiveDocument.CommandBars(i).Name = "Invoice") Then
                   ActiveDocument.CommandBars(i).Enabled = False
               Else
                   ActiveDocument.CommandBars(i).Enabled = True
               End If
               i = i + 1
           Loop While i <= (ActiveDocument.CommandBars.Count)
       End If
       CommandBars.AdaptiveMenus = False
   Else
       Do
           ActiveDocument.CommandBars(i).Enabled = True
           i = i + 1
       Loop While i <= (ActiveDocument.CommandBars.Count )
       CommandBars.AdaptiveMenus = True

   End If

   CommandBars("Invoice").Enabled = True
   CommandBars("Invoice").Visible = True

End Sub
***
Sub AutoNew()
   HideAllToolbars
End Sub
***
Sub AutoExit()
   HideAllToolbars
End Sub
***
> Sorry, you are correct - DisableCustomize is not in 2000. Without it I don't
> think you can completely stop user customization.
[quoted text clipped - 60 lines]
> > > > Any help and idea would be highly appreciated !!
> > > > Thx, Gina

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.