Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do i get my menu items to behave 'stick'

    We're upgrading our document management system version. The new DM integration template adds the DM commands Open, Save, Save As, Print, + other menu items

    We have a company interface template which loads our companys menus, toolbars and shortcut keys. We dont need all the Word menus.

    When I remove the menus the result is the default menus jump around.

    For example if I remove the "FIle, New" menu the "File, Properties" menu moves and displays at the top. Ive reset the toolbars. see screen capture.


    Ive looked at the DM template code it has references to ID numbers. Is this a fixed location number on the menus? These numbers don't
    look sequencial. eg if I look at File, SaveAs - the ID number is 748? How would I get/set the correct locations?
    I saw posts on command bar ID's? How do I find out menu item ID's? and how do i get my menu items to behave and "stick"?


    Sub HumSave()
    On Error Resume Next
    Dim oSave As CommandBarButton
    Set oSave = Word.CommandBars("File").FindControl(Tag:="DMSAVE" )
    oSave.Execute
    End Sub

    Sub HumOpen()
    On Error Resume Next
    Dim oOpen As CommandBarButton
    Set oOpen = Word.CommandBars("File").FindControl(ID:=23)
    oOpen.Execute
    End Sub

    Sub HumSaveAs()
    On Error Resume Next
    Dim oSaveAs As CommandBarButton
    Set oSaveAs = Word.CommandBars("File").FindControl(ID:=748)
    oSaveAs.Execute
    End Sub

    Sub HumPrint()
    On Error Resume Next
    Dim oPrint As CommandBarButton
    Set oPrint = Word.CommandBars("File").FindControl(ID:=4)
    oPrint.Execute
    End Sub
    Attached Images Attached Images

  2. #2
    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: how do i get my menu items to behave 'stick'

    Are you removing menu items in code? If you remove them by altering the menus themselves in your global template, then Word will try to reconcile the customizations and the results might be less predictable.

    This article is for Word 2000, but probably works in 2002-2003 as well: WD2000: How to Generate a List of Command Bar Names, Captions, and ID Numbers.

    I think code for this has been posted in the Lounge, as well.

    Added: The Id is not a position number. To determine the position, look at the index of the control in the CommandBarControls collection. I assume this is a read-only value. There might be another one you can use if you want to move a control, but I haven't popped open the VBE's Object Browser to explore.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do i get my menu items to behave 'stick'

    thanks Jefferson

    Im removing and adding menu items via the method, Tools, Customise... and moving menu items just by selecting the item and dragging off the menu.

    is there another way Im suppose to do this?

    Ill take a look at the MS artice

    diana

  4. #4
    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: how do i get my menu items to behave 'stick'

    For more control, rather than alter the menus in the template, you can use VBA to alter the menus in an AutoExec procedure.

Posting Permissions

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