Results 1 to 13 of 13
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Menu Bar (Word XP)

    I modified the menu bar in one template and want to copy that menu bar to all the other templates already created based on the master template. Using the Templates and Add-Ins Organizer, I can copy the macros to the new templates with no problem, but cannot see any option to copy the Menu Bar. Is there a way to do this. I can create a custom Toolbar, but I want to change the Menus and disable the functions that I don't want the user to have access to.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar (Word XP)

    I haven't used Word 2000, but in all past versions, you cannot copy menus or menu modifications. The best way to do this is to create a custom toolbar. On the custom toolbar, you create a New menu (Tools/Customize...). Then you copy your macros & items to the toolbar. You can actually do this without creating a dropdown toolbar, but I like to do that so it looks like a menu. You can then copy this toolbar to other templates (you must also copy the associated macros). Then you can copy the individual items to a new menu in each template.
    Hope this helps,

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Menu Bar (Word XP)

    After posting and re-reading your post, it may be that you should use an AutoOpen or AutoNew macro to modify the menus in code. The manner and sequence in which Word merges and reconciles menus among templates is not what I would consider to be reliable. Also, my macro would be very cumbersome to use to copy ALL of the menus. Could be done, I think, but no fun.

  4. #4
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Menu Bar (Word XP)

    Thank you so much for your efforts at solving this little Word annoyance. I tried every way I could think of and it didn't work. I will create a custom toolbar with buttons and with the menu, copy it into each template and then drag the menu I need from the toolbar onto the menu for each template. I just did not want to recreate the menu manually in each one. It's only 19 templates, after all...and that is just for 1 hospital...6 more hospitals in the same system to create templates for...

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar (Word XP)

    Hi Jefferson:
    Thanks for this little macro. It'll save a lot of time (I laboriously drag items from menu to toolbar or vice versa). I have three questions, please:

    1. I noticed that the line CustomizationContext = Word.Templates.Item(2) would put the toolbar in whatever template was listed as the 2nd loaded global template under Tools/Templates & Add-ins. However, if I only loaded 3 add-ins (+ normal.dot), the new toolbar seemed to be in normal.dot. I gather that b/c I'd get the question whether I wanted to save changes to normal.dot when I closed Word. Yet, in the Organizer, I could not find the temporary toolbar. Could you explain what is going on?

    2. How can I change that line to use a specific named template?

    3. How would you modify it to copy from a toolbar to a menu, while making sure that you saved the toolbar & menu in the appropriate template?

    Thanks in advance,

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Menu Bar (Word XP)

    1. I seem to be having similar confusion among my Templates collection. Definitely not safe to use the numeric index! I'm beginning to wonder if the Organizer recognizes unsaved changes or only reads what's on disk? My tests just now were botched, so I'll have to revisit this later.

    2. Replace the "2" with "FileName"; the full path shouldn't be needed, but should be accepted if used.

    3. The toolbar-to-menu should simply reverse the source and destination, but I haven't tested it.

  7. #7
    Lounger
    Join Date
    Aug 2002
    Location
    Sierra Madre, California, USA
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar (Word XP)

    Since it sounds like these menu items are the same for each template:
    1. I would remove them from the individual templates
    2. make one global template with the customized menubar (it doesn't have to have anything else in it)
    3. place it in Word's startup folder so it loads when word starts.

    (I have a toolbar in the global template that has a copy of all the menu buttons so I never have to worry about loosing them. This method has worked great since the many issues I faced with trying to copy menus from one template to another) Now I only have one place to make changes to.

  8. #8
    Star Lounger
    Join Date
    Sep 2001
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar (Word XP)

    Since we are doing templates for different customers with integrated toolbars, we had the same problem.
    We solved it by programming a maintenance procedure, which stays inhouse and is not delivered to the customer. This maintenance routine will delete all cutsomizations and then rebuild the menus and toolbars needed. If anything changes during the lifecycle of the product, we simply adapt the maintenance routine and run it again for all templates concerned.

  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar (Word XP)

    Hi Jefferson:
    I just tried this again, but can't seem to save the toolbar. What I did was copy the code to a global template (after changing the menu & toolbar names). I ran it & it created the toolbar. Not only couldn't I find the toolbar in the Organizer, but when I closed Word, saved changes to the template, & reopened it, the toolbar had disappeared. In fact, I looked in most of my templates for it.

    Got any ideas? What I was hoping was to be able to have alternate Work menus, but that may not be possible.

  10. #10
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Menu Bar (Word XP)

    I was mistaken, I think, to make it a temporary toolbar. This version creates a non-temporary toolbar and saves it in the template, then opens the Organizer. I guess you can use the Organizer to delete it after making a copy.
    <pre>Sub CopyPopup2()
    ' Copy a menu from the menu bar to a toolbar...
    ' Present user an InputBox with a template list to pick from, return the index
    Dim strPrompt As String, strValid As String, intCounter As Integer
    Dim strInput As String, tmpTarget As Template
    strPrompt = "Choose the template that contains the menu to copy:"
    With Word.Templates
    For intCounter = 1 To .Count
    strPrompt = strPrompt & vbCrLf & intCounter & ": " & .Item(intCounter).Name
    strValid = strValid & CStr(intCounter) & "|"
    Next
    End With
    Do
    strInput = Trim(InputBox(strPrompt, "Choose template"))
    If strInput = vbNullString Then Exit Sub
    If InStr(1, strValid, strInput & "|") > 0 Then
    ' Successful user selection! Create reference to template
    Set tmpTarget = Word.Templates.Item(CInt(strInput))
    Exit Do
    End If
    MsgBox "Please enter a valid file number, or leave blank to cancel."
    Loop
    ' Create toolbar
    Dim cbPopSrc As CommandBarPopup, cbDest As CommandBar
    ' Set source menu (user selected)
    CustomizationContext = tmpTarget
    strPrompt = "Choose the menu to copy:"
    strValid = vbNullString
    With CommandBars("Menu Bar").Controls
    For intCounter = 1 To .Count
    strPrompt = strPrompt & vbCrLf & intCounter & ": " & .Item(intCounter).Caption
    strValid = strValid & CStr(intCounter) & "|"
    Next
    End With
    Do
    strInput = Trim(InputBox(strPrompt, "Choose menu"))
    If strInput = vbNullString Then
    Set tmpTarget = Nothing
    Exit Sub
    End If
    If InStr(1, strValid, strInput & "|") > 0 Then
    Set cbPopSrc = CommandBars("Menu Bar").Controls.Item(CInt(strInput))
    Exit Do
    End If
    MsgBox "Please enter a valid menu number, or leave blank to cancel."
    Loop
    ' Create destination toolbar
    Set cbDest = CommandBars.Add(Name:="Temp For Moving Menu", _
    Position:=msoBarFloating, MenuBar:=False, Temporary:=False)
    cbDest.Visible = True
    ' Copy entire popup to floating toolbar; save toolbar to template
    cbPopSrc.Copy bar:=cbDest
    tmpTarget.Save
    ' Clean up objects
    If Not (cbDest Is Nothing) Then Set cbDest = Nothing
    If Not (cbPopSrc Is Nothing) Then Set cbPopSrc = Nothing
    If Not (tmpTarget Is Nothing) Then Set tmpTarget = Nothing
    ' Display Organizer for copying
    With Dialogs(wdDialogOrganizer)
    .DefaultTab = wdDialogOrganizerTabCommandBars
    .Show
    End With
    End Sub</pre>

    Hope this works out better.

  11. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar (Word XP)

    Tried it real quick but this appears to work great! I love it. Thank you very much! <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Menu Bar (Word XP)

    The part I gave up on was showing the correct template in the dialog. The .Source property was ignored. Oh well, close enough. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  13. #13
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Menu Bar (Word XP)

    <P ID="edit" class=small>(Edited by jscher2000 on 14-Sep-03 11:27. )</P>Here's a workaround, a macro to copy a menu to a toolbar. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> Actually, I tried to come up with a way to copy between two open templates and I just couldn't.

    <img src=/w3timages/censored.gif alt=censored border=0>
    <img src=/w3timages/censored.gif alt=censored border=0> Updated 9/14/03: That code did not work. See <post#=293669>post 293669</post#> for a better approach.
    <img src=/w3timages/censored.gif alt=censored border=0>

    Can you use this and then copy the toolbar? In theory, you then could reverse the process to add it back to a menu bar. Naturally, the Module.Procedure names must match in order for the menu to actually work in the new template.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •