Assigning keys

M

Marie Curry

I want to hit Alt L and have it go automatically to the next back slash \ in the report. How do I do that?
 
S

Steve

Marie...

1. Put code below into Module in Normal template.

Sub FindSlash()
Dim myRange As Range

Set myRange = ActiveDocument.Content
With myRange.Find
.ClearFormatting
findText = .Text
replText = .Replacement.Text
.Text = "\"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
End Sub

2. Set up macro to execute on Alt-L
2a. Menu Tools\Customize...
2b. Select "Commands" tab. Click on Keyboard button.
2c. In "Categories" box on left, scroll to "Macros"
2d. In "Macros" listbox on right, scroll to "FindSlash"
2e. In "Press new shortcut key" textbox, press your Alt-Shift-l combination.
2f. Click "Assign," then close the dialog box. Close the next dialog box.
You are set to go.


Marie Curry said:
I want to hit Alt L and have it go automatically to the next back slash \
in the report. How do I do that?
 

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