Results 1 to 6 of 6

Thread: Context Menus

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Posts
    79

    Post

    Is it possible that I can have a menu that I can change captions from executing time? Ie, when someone clicks on one item, the menu relates to that without having to have tons of different menus?

    Thanks

  2. #2
    Junior Member
    Join Date
    Dec 1999
    Location
    Germany
    Posts
    17

    Post

    You must reference your Project to the MS Office 8.0 Object Library then you can use this objects to add or remove menus to your command bar.
    E.g:

    Code:
    Dim newCmdButton as CommandBarButton
    
    Set newCmdButton = CommandBars(2).Controls.Add(1, , , VBInstance.CommandBars(2).Controls.Count)
    
    With newCmdButton
       .Caption = "MyCaption"
    End With
    Regards,
    Frank

  3. #3
    Junior Member
    Join Date
    Dec 1999
    Location
    Germany
    Posts
    17

    Post

    Damn!!!
    Why are there no linebreaks in the codesection! HELP!!!

    Code:
    Here is the first line
    
    And where is the empty line??
    
    
    sldfkj

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Code:
    First Line
    
    
    Skip 2 lines
    
    Skip 1 line

  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    looks like you have to skip 2 lines instead of just 1.....

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Post

    I may not understand your original question, but you can change a manu's caption anytime in your code with someting like MyMenu.Caption = "this is a new caption"

    ------------------
    Marty

Posting Permissions

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



Click Here to Expand Forum to Full Width