Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Toolbar Buttons Toggle (W97)

    I have a button that will check to verify that a set of styles are not assigned to the text and then assigns the Style Bold (macro: AssignStyleBold).
    If RetiredRequirementCheck() = False Then
    Selection.Style = ActiveDocument.Styles("bold")


    How do I get the button to toggle? The best I've been able to do is create a separate button that returns the normal font. - Jody

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Toolbar Buttons Toggle (W97)

    Jody,

    At risk of sounding like a broken record<g>, more information is required here too. It is possible to toggle the appearance or text of toolbar buttons - but it's unclear whether you are trying to toggle the appearance of the button, or simply have its action act like a toggle. If the latter, does something like:

    If RetiredRequirementCheck() = False Then
    Selection.Style = ActiveDocument.Styles("bold")
    Else
    Selection.Style = ActiveDocument.Styles("Normal")
    End If

    do what you need?

    Gary

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Toolbar Buttons Toggle (W97)

    I was going for the Visual toggle.... like the Bold button on the MSO formatting toolbar. When something is marked bold it appears depressed and when you click it again it lifts and the font returns to normal.... so I guess it's a combination of both.

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Toolbar Buttons Toggle (W97)

    Try looking at the 'msoButtonState' constants such as msoButtonUp and msoButtonDown.

    Gary

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

    Re: Toolbar Buttons Toggle (W97)

    If you change the state of a toolbar button to Up or Down then it will remain in that state until you change it again.

    This is fine if the button represents some application wide status.
    If the button state represents something about the document then you will need to modify it in a DocumentChange event.
    If the button represents something about the current selection or paragraph then I have never found a good way to keep it updated.

    StuartR

Posting Permissions

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