Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create Word Borders Toolbar button

    Word (97) will not create the built-in "Borders" toolbar button programmatically unless YOU know the secret (I do not!):

    Try this:
    <pre>dim cbar as commandbar
    dim barbutton as commandbarbutton
    Set barbutton = cBar.Controls.Add(Type:=14, ID:=203)
    With barbutton
    .Visible = True
    End With
    </pre>


    and you'll get a blank button with the dropdown arrow. It's supposed to be the "Borders" button, but it's empty. Anybody know know the secret?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Word Borders Toolbar button

    New discovery:

    If you click Tools>Customize then Close, the Borders button is returned to it's normal, useful state. Go figure.

    You'd think then, that

    Commandbars("Menu Bar").controls("Customize...").reset

    would do the same thing. Nope.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    calacuccia
    Guest

    Re: Create Word Borders Toolbar button

    Kevin,

    It is strange.

    But here is a trick, by copying the CommandBarbutton:

    Sub ttt()
    Dim myCBar As CommandBar
    Dim myButton As CommandBarPopup
    Set myCBar = CommandBars.Add
    Set myButton = CommandBars("Formatting").Controls("&Borders")
    myButton.Copy myCBar
    End Sub

Posting Permissions

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