• how to set default option button using index num

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » how to set default option button using index num

    Author
    Topic
    #351663

    Within a frame I have many option buttons.
    Does Word store option buttons with a next sequential value.
    for example command buttons have next sequential number as per their order
    -1
    0
    1
    2

    Given an index number I would like to use that to set option button as default button.
    eg
    passed index = 3

    therefore
    frameName = optionbutton(3) = default

    Any ideas?
    Thanks in advance!
    Diana

    Viewing 1 reply thread
    Author
    Replies
    • #509762

      Diana,

      Each option button has a name. Go into design mode (the set square icon on the control toolbar) and right click on the option button; select “properties” to see the name

    • #509788

      In VBA, you fake an array by naming the controls consistently (i.e., Option1, Option2, Option3) and then loop through the controls collection testing for control names where the left however many characters of the name equals the fake array base name, in this case “Option”. When you find one, you do whatever you want to do for each of that group of controls.

    Viewing 1 reply thread
    Reply To: Reply #509762 in how to set default option button using index num

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel