I have tried several code varients to customise the menus shown when a
new document is generated from my template. So far all I've been able
to do is inadvertently cause errors on the document close event. All I
would like is my normal development menus to appear when opening the
template itself and the few commands I allow the users when opening the
template. Many of my macros rely on specific events such as FilePrint
and FileSave, FileSaveAs, etc. and I'd like to only make these
available via custom toolbar shown. Right now I'm having to tie a
customization to the open template and then enable the menus whenever
working on the template.....I'm lazy like that.
I saw some code once, in a website far far away, there was a jedi there
and a wookie, but alas, I cannot remember nor find it again.
Brian
Jay Freedman - 02 Dec 2005 05:14 GMT
>I have tried several code varients to customise the menus shown when a
>new document is generated from my template. So far all I've been able
[quoted text clipped - 10 lines]
>and a wookie, but alas, I cannot remember nor find it again.
>Brian
Hi Brian,
Just save all the toolbars in the template, and then include something
like this in ThisDocument:
Private Sub Document_New()
CommandBars("User").Visible = True
CommandBars("Developer").Visible = False
End Sub
Private Sub Document_Open()
If ActiveDocument.Type = wdTypeTemplate Then
CommandBars("User").Visible = False
CommandBars("Developer").Visible = True
Else
CommandBars("User").Visible = True
CommandBars("Developer").Visible = False
End If
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.