Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Can "flush right" in WP be done in Word?
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 |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
If you're not familiar with macro code, it might not be obvious what
Greg's macro is doing. Unlike WordPerfect, Word relies on using a tabstop -- either right-aligned or decimal -- at the right margin to create flush-right text in a paragraph that's basically flush-left. Once the tabstop is in place, type the text at the left, hit the Tab key, and type the text at the right. You can do that manually, or you can use the macro. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org On Wed, 16 Mar 2005 19:30:16 -0500, "Greg Maxey" wrote: 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Comparing Documents in Word 2003 and Word 2002 - VERY Weird Proble | Microsoft Word Help | |||
Converted document from WordPerfect. New footnotes are not being. | Microsoft Word Help | |||
word xp crashes after macros are recorded | Microsoft Word Help | |||
How to change merge forms from Word Perfect to Microsoft Word | Microsoft Word Help | |||
Macro that will add the file path & date to Word footnotes? | Microsoft Word Help |