View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Bear[_2_] Bear[_2_] is offline
external usenet poster
 
Posts: 314
Default keyboard shortcut

Basil:

There is no single command that matches what you're trying to do, so you
won't be able to assign a keyboard shortcut to an existing command.

It would probably be simplest for you to define a character style that has
no other attributes than an underline of the color you want to use. To
underline the selected word, phrase or paragraph, you'd then apply that
character style to the selection.

Once you've created the style you CAN use a keyboard shortcut to assign it.
You'd use Tools Customize Keyboard as you've done, but in the Categories
list select Styles, then in the Styles list, find your underline character
style.

To see (roughly) what happens when you underline the selected word with a
custom color -- as you've been doing manually -- record a macro of your
actions. Then select and edit the macro to see the result. It might look
something like:

Sub x()
'
' x Macro
' Macro recorded 5/4/2007 by David Chinell
'
With Selection.Font
.Name = "Arial"
.Size = 12
.Bold = True
.Italic = False
.Underline = wdUnderlineSingle
.UnderlineColor = wdColorRed
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorGray50
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
End With
End Sub

As you can see, every setting possible in the Font dialog box is there in
the command. If you ran this macro on a selection, it would not only
underline it, but set the font and size and so on. So you'd want to delete
everythig except the underline parts:

Sub x()
'
' x Macro
' Macro recorded 5/4/2007 by David Chinell
'
With Selection.Font
.Underline = wdUnderlineSingle
.UnderlineColor = wdColorRed
End With
End Sub

Once you saved this macro you could then assign a keyboard shortcut by
selecting Macros in the Categories list and searching for your macro in the
Macros list.

Probably a lot more than you wanted to know.

Bear
--
Windows XP, Word 2000