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 / Menus and Toolbars / December 2005

Tip: Looking for answers? Try searching our database.

Forcing Custom toolbar on Document_New

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
celticangyl@gmail.com - 02 Dec 2005 04:23 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
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.
 
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.