On Fri, 15 Apr 2005 15:03:02 -0700, Linda3365
wrote:
In (dare I mention it?) WordPerfect, I had a shortcut to insert an underline
to the right-hand margin of the page. It was the handiest macro I had. Can it
be done in Word 2003?
Put this macro in your Normal.dot or another global template (see
http://www.gmayor.com/installing_macro.htm) and assign a keyboard
shortcut to it
(
http://www.word.mvps.org/FAQs/Custom...roToHotkey.htm).
Public Sub RightMarginUnderline()
Dim tabPos As Single
With Selection.Sections(1).PageSetup
tabPos = .PageWidth - .RightMargin - .LeftMargin
End With
With Selection
.Paragraphs(1).Range.Select
.MoveEnd Unit:=wdCharacter, Count:=-1
.Collapse wdCollapseEnd
.Paragraphs(1).TabStops.Add _
Position:=tabPos, _
Alignment:=wdAlignTabRight, _
Leader:=wdTabLeaderLines
.InsertAfter vbTab
End With
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:
http://word.mvps.org