
Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> Hi all.
>
[quoted text clipped - 28 lines]
>
> Gina
Charles,
many thanks for answering so extensively.... I tested the situations you
described and indeed Normal.dot is affected by all the hiding stuff :-((
a fact I haven't thought of yet .... big problem now...
I am not familiar with word coding or behaviour ... my thoughts were: when I
do a macro to hide/ disable all but my personal toolbar it would only affect
documents coming from that particular template ..... Invoice1.dot
here's my code
***
Sub HideAllToolbars()
Dim i As Integer
i = 1
Application.WindowState = wdWindowStateNormal
If ActiveDocument.AttachedTemplate = "Invoice1.dot" Then
Do
If ActiveDocument.CommandBars(i).Name <> "Invoice" Then
ActiveDocument.CommandBars(i).Enabled = True
Else
ActiveDocument.CommandBars(i).Enabled = False
End If
i = i + 1
Loop While i < (ActiveDocument.CommandBars.Count)
CommandBars("Invoice").Enabled = True
CommandBars.AdaptiveMenus = False
End If
End Sub
***
Sub AutoExec()
HideAllToolbars
End Sub
***
What I am trying to accomplish:
my 'invoicing programme' in access 2000 is transferring data to word.
Before, the company was writing their invoicing stuff still on a typing
machine. I would like to make sure, that if they want to use a computer for
the invoicing, they should do it through my programme and ultimately renew
the license after a year rather than making a copy of my template by typing
invoices in word itself!!
therefore I do not work on a 'visible' *.dot .... and via access vba a copy
is made and named appropriately and destoys the copy afterwards.
You are definitrely right ..... I would be very angry if any programme would
affect my other work with word negatively in any way!!! I would sue them as
well!!
Maybe you have an idea of how I can code what I intend to do ....
if at all...
Gina
> You would want to go through the entire commandbars collection and mark them
> all invisible and disabled and then fix it when you left. Have you thought
[quoted text clipped - 45 lines]
> >
> > Gina
Gina - 04 Nov 2005 15:58 GMT
Charles,
made some changes to the code:
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 stopping macro keys on opening have not been dealt with
....
neither the fact that when user changes something in the document the dialog
save with the 3 upcoming options, they get promted :-(
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
***
> Charles,
>
[quoted text clipped - 112 lines]
> > >
> > > Gina
Tony Jollans - 04 Nov 2005 19:24 GMT
Hi Gina,
You should be able to disable the toolbar right click by ..
CommandBars("Toolbar List").Enabled = False
but that doesn't entirely stop user customization.
--
Enjoy,
Tony
> Charles,
> made some changes to the code:
[quoted text clipped - 202 lines]
> > > >
> > > > Gina
Charles Kenyon - 04 Nov 2005 16:20 GMT
You can set the customization context to your template.
CustomizationContext = ActiveDocument.AttachedTemplate
You don't want ActiveDocument.CommandBars but Application.Commandbars or
simply CommandBars, I think.
I would recommend posting your working code in the vba.customization
newsgroup. I am really a beginner at this.

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> Charles,
>
[quoted text clipped - 123 lines]
>> >
>> > Gina
Charles Kenyon - 04 Nov 2005 16:42 GMT
Also, take a look at the MVP FAQs on customization and vba. One page that
may help is http://word.mvps.org/FAQs/MacrosVBA/SetPosnOfCmdBars.htm. You
can position commandbars off the screen!

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> You can set the customization context to your template.
> CustomizationContext = ActiveDocument.AttachedTemplate
[quoted text clipped - 137 lines]
>>> >
>>> > Gina
Gina - 07 Nov 2005 16:18 GMT
Hi Charles and Tony
Sorry I have been a few days off.
Tony's 'CommandBars("Toolbar List").Enabled = False'
did the desired trick :-))
Charles, I will follow your advice with changing to the vba cust newsgroup
... thanks for the link!!!
Many many thanks for your help with my problem(s) !!
Gina
> Also, take a look at the MVP FAQs on customization and vba. One page that
> may help is http://word.mvps.org/FAQs/MacrosVBA/SetPosnOfCmdBars.htm. You
[quoted text clipped - 142 lines]
> >>> >
> >>> > Gina
Tony Jollans - 07 Nov 2005 17:11 GMT
Glad that did the trick for you.
> Sorry I have been a few days off.
You're allowed - it _was_ the weekend :)
--
Enjoy,
Tony
> Hi Charles and Tony
>
[quoted text clipped - 207 lines]
> > >>> >
> > >>> > Gina