Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    May 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table borders custom buttons (2000 SR1a)

    I have a lot of tables to which I want to change the formatting. The tables are of varying sizes and layouts, and include merged cells. Sometimes I use 3 different thicknesses of border, to separate out sub-categories of information within the table.
    Is there a way of creating a shortcut to apply a specific line thickness to a cell? For example, I use bottom line thicknesses of 1/2 pt in grey, 1/2 point in black, and 1.5 point in black. Ideally I would like to have a single toolbar button for each of these options, rather than having to change the line thickness and colour each time I select a different cell. Is this possible?

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

    Re: Table borders custom buttons (2000 SR1a)

    Terner,

    One way to do this would be to record three macros, one for each of the 'apply border' operations that you want to be able to quickly reproduce. Then assign each of these macros to its own custom toolbar button.

    Gary

  3. #3
    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: Table borders custom buttons (2000 SR1a)

    Following up on Gary's idea, there is a way that you can add your macros to the right-click shortcut menu that is specific to tables. It has been discussed in the Lounge before, either on this board or in VBA, but I can't remember the exact sequence of steps. Good luck!

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Table borders custom buttons (2000 SR1a)

    Following up from Jefferson, who followed up from Gary: assume you have the 3 macros recorded, then
    - get to the Customize dialog (several ways to do: click Tools menu, Customize is one way)
    - click the Toolbar tab and check Shortcut Menu item - this will open a toolbar for shortcuts which has table as an item
    - now, back on the Customize dialog, click on the Commands tab, scroll down in the Categories on the left side until you get to macros. On the right side (Commands scroll box), click on the macro you want and, without letting go of the mouse button, drag the item from there to the Shortcut menu toolbar. Hover over the table item and it will expand for the different shortcut menus related to tables. Still w/o releasing the mouse button, move down to the one you want and hover there. The submenu (which will be actual menu presented to you when you right click in a table) will expand out. Drag your item onto the submenu and place it where you want (as indicated by the black line). Now release the mouse button and you're done.

    You can also try something similar with the Tables and Borders toolbar.

    HTH

    Fred

  5. #5
    New Lounger
    Join Date
    May 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table borders custom buttons (2000 SR1a)

    Hi folks,

    Thanks for the suggestions; I've almost got it working as needed. But there is still a problem.

    When I run the macro, it isn't just the bottom border that changes. It applies the formatting of all borders as specified when I created the macro. Eg. If I select my topmost header row before recording a macro to change the bottom border thickness to 1pt, it also records the fact that my top border (the one for the whole table) is say 1.5pt. So when I run the macro in the middle of a table, it changes both the top and bottom borders to 1.5 and 1pt respectively, when all I want is the bottom border to change.

    Is there a way of just changing the bottom border without affecting the others?

    Since I use 'only' 3 different horizontal border types, I guess I could create a macro for each of the 3 top border formats that I would experience so that it leaves it in the same state, but it's not exactly an elegant solution.

    Assigning the macros to right-click shortcut menus works a treat - thanks for the tip!

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table borders custom buttons (2000 SR1a)

    When I record changing the bottom border to, say, 4.5pts, I get:

    Options.DefaultBorderLineWidth = wdLineWidth450pt
    With Selection.Borders(wdBorderBottom)
    .LineStyle = Options.DefaultBorderLineStyle
    .LineWidth = Options.DefaultBorderLineWidth
    .ColorIndex = Options.DefaultBorderColorIndex
    End With

    This doesn't change any of the other borders in any cell in which I have the insertion point. Is this what you're looking for?

  7. #7
    New Lounger
    Join Date
    May 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table borders custom buttons (2000 SR1a)

    Problem solved.

    Unlike the macro you created, mine had definitions for all borders, none of which were 'defaul'. I realise now that my mistake was changing the border via the Format / Borders and Shading menu. The better way was to display the Tables and Borders toolbar, and record my macro changing the border via the toolbar buttons, which do seem to work as simple toggles. The resultant macro is essentially the same as what you have, and did work to just change the bottom border, leaving the others untouched.

    Thanks

Posting Permissions

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