Assigning a keyboard shortcut for Borders & Shading

J

jodzeee

I used to have a customized keyboard shortcut to bring up the Borders &
Shading dialog box for a table. I'm starting over because my normal.dot
is very old and probably corrupt so I want a fresh start. I'm using
Word 2003.

I cannot find in the shortcuts anything that will give me this dialog
box. In my world, it should be under Format>Borders & Shading, or even
Tables>Format>Borders & Shading. I cannot find anyway to assign this
shortcut.

I suppose I could create a macro and assign that a shortcut, but I
can't believe this isn't an option!

Any ideas?

Jodi
 
J

jodzeee

I tried that. All that does is clear all borders. I also tried it with
"Shading" in All Commands with the same result.

Also, I discovered I cannot make a macro because I need to close the
dialog box I'm opening in order to stop recording, which makes the
macro do nothing. Maybe there's a way around this, I don't know a lot
about macros.

Is there a way to copy keyboard shortcuts from another template like
styles and macros? I found something on the Internet that someone
created but it didn't work for me. I think because it was for a
previous version of Word.

Any other advice?

Jodi
 
S

Stefan Blom

Assign a keyboard shortcut to the FormatBordersAndShading built-in
Word command. You'll find it in the "All Commands" category in the
Customize keyboard dialog box. (You can open the dialog box via
Tools>Customize, click the Options tab, and click the Keyboard
button.)
 
S

Suzanne S. Barnhill

Did you try this, Stefan? If that command were listed there, do you think
this thread would exist?
 
S

Stefan Blom

Yes, I tried it -- in Word 2000. Are you saying the command no longer
exists in recent versions of Word?
 
S

Suzanne S. Barnhill

Not present in Word 2003. Not listed in All Commands (or anywhere else that
I can find) either on the Commands tab or in the Customize Keyboard dialog.
It does seem very odd, since this would obviously make it impossible to
restore that menu command if it were inadvertently deleted (other than by
resetting the menu).
 
S

Stefan Blom

Strange, but it wouldn't be the first time that this has happened. I
believe in Word 97 the command to insert a frame (at least in one of
the categories) was called something entirely different.
 
S

Suzanne S. Barnhill

Yes, InsertFrame appeared in All Commands, but in the Insert category it was
called "Horizontal" (though it still had the frame icon).
 
S

Stefan Blom

That's right, I now recall that the icon was the reason I could
identify it! And when I added it to a menu, it displayed the correct
menu caption...
 
J

jodzeee

If I open my old template where I had the shortcut stored, I can
pretend I'm assigning the shortcut to something else and it says,
Currently assigned to: FormatBordersAndShading

and it works fine in that template.

But in my new normal.dot, this is NOT an option! How frustrating. I'm
sure there are others missing, but I'm focusing on this one right now
because I use it a lot!

Any ideas of how I could create a macro to bring up the dialog box and
assign a keyboard shortcut to that?

Jodi
 
S

Suzanne S. Barnhill

Unfortunately, *recorded* macros to open dialog boxes fail because you have
to actually do something in the dialog box for it to be recorded. If you
know the VBA you can probably *write* a macro to do it. (It would involve
the terms "Dialogs" and "Show," but beyond that, I'm clueless.)
 
K

Klaus Linke

This should do the trick. I add the button to the menu bar, since that's guaranteed to be visible.
But you can hold down the Alt key and then drag it onto any toolbar.

Dim myButton As CommandBarButton
Set myButton = CommandBars("Menu Bar").Controls.Add(ID:=3466)
myButton.Style = msoButtonCaption

Regards,
Klaus
 
J

jodzeee

Thank you. That helped me understand what to do with the code.

However, what I want is a keyboard shortcut to invoke the Borders &
Shading dialog box, not a button.

If I assign a shortcut to this macro, it just adds the button to my
menu bar each time I use the shortcut, it does not bring up the dialog
box.

Forgive me if there's something obvious here that I'm missing!

Jodi
 
K

Klaus Linke

Hi Jodi,

Sorry, misread the problem. Usually you can assign a shortcut by using Alt + Ctrl + Num+ (hold Alt key plus Ctrl key plus the "+" key on the numeric keypad on the right), then clicking on the menu item or button. But that doesn't work here.

You would need a macro as Suzanne suggested:

Sub myFormatBordersAndShading()
Dialogs(wdDialogFormatBordersAndShading).Show
End Sub

Then go into "Tools > Customize... > (Commands tab) > Keyboard shortcuts", choose "Category: Macros" and then your macro on the right.

(See http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm for more detail)

Greetings,
Klaus
 
J

jodzeee

Thank you, that is EXACTLY what I wanted but didn't know how to do.

Of course...in the meantime, I found that instead of Borders and
Shading, the command exists in ALL COMMANDS > BORDER LINE COLOR, which
also brings up the same dialog box.

Thank you Klaus, Stefan, and Suzanne !!!

Jodi
 
S

Suzanne S. Barnhill

Good lord! That's one we'll have to remember! It's as bad as Word 97 calling
InsertFrame "Horizontal" instead of "Frame." <sigh>
 
S

Stefan Blom

You are welcome -- and thank you for the feedback.

But since you located the "lost" command, one might argue that you in
fact had to do the job yourself... :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top