Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    A Couple of Questions about ToolBars (Word 97 and >)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Loungers

    I have a couple of questions about Toolbars and their objects.

    1) How can someone grab the value picked from a dropdown on a Toolbar:

    Set cbMenuDropDown = cbToolBar.Controls.Add(Type:=msoControlDropdown)

    '/Populate the DropDown.
    With cbMenuDropDown
    For sPricePerWord = 0.01 To 0.99 Step 0.01
    .AddItem Format(sPricePerWord, "0.00")
    Next sPricePerWord
    End With

    So now how do I grab the value picked by the user using cbMenuDropDown? There is no value property <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    2) How do you assign a macro to a button on a Toolbar.

    I checked the Righ-Mouse-Click and then Customize and then <img src=/S/confused.gif border=0 alt=confused width=15 height=20> There was no Assign Macro like in MS-Excel?

    I tried to Record a Macro and then assign it to the new Toolbar button, but then I did not see anything that will make that possible?

    I am thinking of going back to MS-Excel <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    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: A Couple of Questions about ToolBars (Word 97

    For an example for Word 2000, see <post#=165392>post 165392</post#>. In that scenario, the dropdown is populated with the names of bookmarks in the document, and the property retrieved is .Text (which I assume you will also want). I have no idea whether it is backwards compatible to Word 97.

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

    Re: A Couple of Questions about ToolBars (Word 97 and >)

    2) You can't assign a macro to an existing toolbar button in Word (except in code). Instead, you create a new toolbar button.
    - Select Tools | Customize...
    - Activate the Commands tab.
    - Select Macros in the Categories list.
    - Select a macro and drag it to the desired position on a toolbar or menu.

  4. #4
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: A Couple of Questions about ToolBars (Word 97

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Jefferson

    I do not know why I bother the Lounge, maybe I should just send you my question <img src=/S/duck.gif border=0 alt=duck width=23 height=23>

    The .Text was not in the Intellisense in Word 2000? Why? <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    Thank again

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  5. #5
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: A Couple of Questions about ToolBars (Word 97 and >)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Hans

    OK so if it can only be done via code, I will build the ToolBar and its controls via code and assign the macro to run my procedure to the button via code. That is not a problem.

    The problem is:

    Must I sacrifice my nice button face that I customized from an existing button Face? <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    How can I copy the customized button face to my code-created button on my toolbar?

    Thanks again

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

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

    Re: A Couple of Questions about ToolBars (Word 97 and >)

    The CommandBarButton object has methods CopyFace to copy the button image to the clipboard and PasteFace to paste an image from the clipboard to a button.

  7. #7
    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: A Couple of Questions about ToolBars (Word 97

    > I do not know why I bother the Lounge, maybe I should just send you my question.

    Trust me, my Lounge rate is much more affordable. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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