Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Progamatically add text to custom button (2k with windows 2k)

    I have decided to programatically add buttons to a custom toolbar. I have figured out the faceID but cannot find a way to use VB to add text next to the picture. I am using the following code sequence but without any luck. The picture is fine but no text.

    start code
    Set oControl = oBar.Controls.Add(ID:=3, before:=3)
    oControl.OnAction = "AddLabor"
    oControl.FaceId = 2151
    oControl.DescriptionText = "Add Labor !"
    end code

    any ideas?

    Thank You
    Kevin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Progamatically add text to custom button (2k with windows 2k)

    You need the Caption property of oControl, and its Style property:

    oControl.Style = msoButtonIconAndCaption
    oControl.Caption = "This is the button text"

Posting Permissions

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