Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    ComboBox ToolBar Button (97, 2K or XP)

    I can create a custom toolbar button which is a combobox (see code below) , but it dosn't seem to have any of the nice autocomplete features that "normal" combobox's have. Also, I don't see any difference between .Style = msoComboNormal and .Style = msoComboLabel. What types of comboboxes/drop-down lists are possible? TIA --Sam
    <pre>Option Explicit
    Public Sub AddComboBar()
    Dim cbar As CommandBar
    Dim ctl As CommandBarControl
    Set cbar = CommandBars.Add(Name:="Demo", Position:=msoBarTop, _
    Temporary:=True)
    cbar.Visible = True
    Set ctl = cbar.Controls.Add(Type:=msoControlComboBox)
    With ctl
    .Tag = "HL"
    .AddItem "Great"
    .AddItem "OK"
    .AddItem "Poor"
    .ListIndex = 0 ' Nothing selected
    .Style = msoComboNormal
    .OnAction = "DoComboBar"
    End With
    End Sub</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 28 Times in 27 Posts

    Re: ComboBox ToolBar Button (97, 2K or XP)

    Hi Sam,

    Sorry I don't have any specific info, other than it's my impression that it's an incomplete implementation in the Word/VBA object model.

    Gary

  4. #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: ComboBox ToolBar Button (97, 2K or XP)

    In experimenting with the style, font, and zoom comboboxes, they don't seem to have nice autocomplete features either...

    There are illustrations of incredibly fancy looking controls under the Type Property for the control objects. The differences between msoControlDropdown and msoControlComboBox are lost on me. The msoControlGauge could be a fun progress indicator, maybe. The graphic ones look a bit complicated to use. Hmmm...

  5. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 28 Times in 27 Posts

    Re: ComboBox ToolBar Button (97, 2K or XP)

    Jefferson,

    How do you get to those control object Type Property illustrations - curious....

    Gary

  6. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ComboBox ToolBar Button (97, 2K or XP)

    In a VBE code window type CommandBars & press F1.
    In help, press the CommandBars collection link.
    Press the CommandBar ComboBox picture link.
    Press the Type property link.

    It's a nice table, but not much use.
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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