View Single Post
  #2   Report Post  
Greg Maxey
 
Posts: n/a
Default

Teacher,

This macro makes it possible to flush right:
See: http://www.gmayor.com/installing_macro.htm

Sub FlushRight()

On Error GoTo ErrorHandling

Dim sngLeftMargin As Single 'left margin setting for current document
Dim sngRightMargin As Single 'right " " "
Dim sngPageWidth As Single 'page width " "
Dim sngWidthToRight As Single 'setting required for custom tab stop

'retrieve document's margin and page width settings
sngLeftMargin = CSng(ActiveDocument.PageSetup.LeftMargin)
sngRightMargin = CSng(ActiveDocument.PageSetup.RightMargin)
sngPageWidth = CSng(ActiveDocument.PageSetup.PageWidth)


sngWidthToRight = sngPageWidth - (sngLeftMargin + sngRightMargin)
Application.ScreenUpdating = False

With Selection
..Paragraphs.TabStops.Add _
Position:=sngWidthToRight, Alignment:=wdAlignTabRight,
Leader:=wdTabLeaderSpaces
..InsertAfter Text:=vbTab
..EndKey Unit:=wdLine

'ensure the next line has the default tab stop
If .Type = wdSelectionIP And _
..End = ActiveDocument.Content.End - 1 Then 'if no line below the current
Line
..TypeParagraph 'new line
Else 'move to the beginning of next line
..MoveDown _
Unit:=wdLine, _
Count:=1
End If

..ParagraphFormat.TabStops.ClearAll 'restore default tab stop
..MoveUp _
Unit:=wdLine, _
Count:=1 'move the insertion point...
..EndKey _
Unit:=wdLine '...to the right margin, ready for text
End With

Application.ScreenUpdating = True 'display on

ErrorHandling:
End Sub

--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support
http://gregmaxey.mvps.org/word_tips.htm

TheTeacher wrote:
WordPerfect has a command,"flush right" which enables a set of
figures to be right justified while the rest of line is left
justified. Can this be done in Word, and if so, how?
Alex