none
Add OpenOrCloseUpPara command to Quick Access Toolbar

    Question

  • The command doesn't seem to be available from ALL COMMANDS for the ribbon or q/a toolbar, but is for Keystrokes.  Any ideas how to add this to q/a toolbar, besides writing a macro?
    Thursday, May 03, 2012 8:49 PM

Answers

  • You can make use of the macro below and attach it to a QAT button.
               

    Sub SetSpacingAbovePara()
    On Error GoTo errhandler

    Application.ScreenUpdating = False
    If Selection.ParagraphFormat.SpaceBefore > 0 Then
    Selection.ParagraphFormat.SpaceBefore = 0
    Else
    Selection.ParagraphFormat.SpaceBefore = 6
    End If

    errhandler:
    Application.ScreenUpdating = True
    Exit Sub
    End Sub

    Stefan Blom, Microsoft Word MVP

    • Marked as answer by orlandp Thursday, May 03, 2012 9:01 PM
    • Edited by Stefan BlomMVP Thursday, May 03, 2012 9:03 PM (fixing line breaks in code)
    Thursday, May 03, 2012 8:59 PM

All replies

  • You can make use of the macro below and attach it to a QAT button.
               

    Sub SetSpacingAbovePara()
    On Error GoTo errhandler

    Application.ScreenUpdating = False
    If Selection.ParagraphFormat.SpaceBefore > 0 Then
    Selection.ParagraphFormat.SpaceBefore = 0
    Else
    Selection.ParagraphFormat.SpaceBefore = 6
    End If

    errhandler:
    Application.ScreenUpdating = True
    Exit Sub
    End Sub

    Stefan Blom, Microsoft Word MVP

    • Marked as answer by orlandp Thursday, May 03, 2012 9:01 PM
    • Edited by Stefan BlomMVP Thursday, May 03, 2012 9:03 PM (fixing line breaks in code)
    Thursday, May 03, 2012 8:59 PM
  • I just wrote a simple macro:

    selection.paragraphformat.openorclosepara and it seems to work. 

    I was just hoping the command available from customize keystrokes was available for the Q/A toolbar

    Thursday, May 03, 2012 9:01 PM
  • I just wrote a simple macro:

    selection.paragraphformat.openorclosepara and it seems to work.

    I was just hoping the command available from customize keystrokes was available for the Q/A toolbar


        

           
    Hmm, I had to double-check that. Indeed, there is a method that you can use, but not "OpenOrClosePara"; it's called OpenOrCloseUp:
        
    selection.ParagraphFormat.OpenOrCloseUp
           
    Obviously, using the built-in method is a lot easier!

    Stefan Blom, Microsoft Word MVP
    Thursday, May 03, 2012 9:07 PM
  • Sorry for the typo.  I actually used the msoParagraphOpenClose image as well (and it shows the space opening or closing up), by assigning it to a tab I made invisible on the toolbar, and that gave me access to the icon on the Q/A toolbar.

    Saturday, May 05, 2012 12:10 AM