Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Location
    Wellington, North Island, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do you show a toolbar button is activated (Office XP)

    Some of the macros I create in Word, Outlook...I assign to a toolbar button. When the macro toggles a particular state I would like to highlight the button in some way when the state is ON, and un-highlight it when the state is OFF. I'm guessing this could possibly be done using msoButtonDown and msoButtonUp but can't figure out how to programme it.

    Can anyone help with a solution?

    Thanks

    Grae

  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: How do you show a toolbar button is activated (Office XP)

    Assigning the property is not difficult
    Attached Files Attached Files

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: How do you show a toolbar button is activated (Office XP)

    <hr>it might be more challenging to find the right control!<hr>
    The real challenge is keeping the button in the correct state as the user does things without using the Macro!

    StuartR

  4. #4
    New Lounger
    Join Date
    Mar 2002
    Location
    Wellington, North Island, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do you show a toolbar button is activated (Office XP)

    Thanks. This works fine in Word, but Outlook doesn't like it.

    In the line, "Set cBarBtn = CommandBars("TestBar").Controls(1)

    it hangs with a compile error "Sub or Function not defined" in relation to "CommandBars".

    Would appreciate assistance with what needs to be defined so it runs in Outlook?

    Grae

  5. #5
    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: How do you show a toolbar button is activated (Office XP)

    Hmmm, you could checks Tools | References... and make sure the object library for MS Office is listed. If not, that's the problem and you'll need to add it. If it is, confirm that your Toolbar name is precisely TestBar and not, Test Bar or something like that.

  6. #6
    New Lounger
    Join Date
    Mar 2002
    Location
    Wellington, North Island, New Zealand
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do you show a toolbar button is activated (Office XP)

    Yes, Hmmmm. I am using Office XP (i.e. 2002) with SP1 installed. The Microsoft Outlook 10.0 Object Library is installed, as is the Microsoft Office 9.0 Object Library. Interestingly, in Outlook if I select the Office 10.0 Object Library (which is used in Word 2002) the system re-sets to the 9.0 OLB. Is there something else missing?

    The name of the Toolbar is OK. Macro runs in Word 2002 just fine.

  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: How do you show a toolbar button is activated (Office XP)

    Do you still have Office 2000 components on your PC? If not, I can't imagine why OL'02 is doing what it's doing. But then again, I still use 2000, and can't explain a lot of what happens in XP!!

Posting Permissions

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