A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Aligning text



 
 
Thread Tools Display Modes
  #1  
Old August 22nd, 2004, 09:38 AM
Jo Farnworth
external usenet poster
 
Posts: n/a
Default Aligning text

Is there a way in Word (as there is in Wordperfect using
Flush commands)to align some words on a line with the
left margin and some words on the same line with the
right margin? In Wordperfect I could set up a document
with a title on the left side and the date aligned on the
right margin but cannot find a way in Word to do this.
  #2  
Old August 22nd, 2004, 11:59 AM
Greg Maxey
external usenet poster
 
Posts: n/a
Default

Jo,

Here is a macro for doing this:

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
A peer in "peer to peer" support
Rockledge, FL
To e-mail, edit out the "w...spam" in

Jo Farnworth wrote:
Is there a way in Word (as there is in Wordperfect using
Flush commands)to align some words on a line with the
left margin and some words on the same line with the
right margin? In Wordperfect I could set up a document
with a title on the left side and the date aligned on the
right margin but cannot find a way in Word to do this.



  #3  
Old August 22nd, 2004, 02:15 PM
Doug Robbins
external usenet poster
 
Posts: n/a
Default

Set the paragraph formatting to left aligned and set a right aligned tab on
the right margin and insert a tab space between the left and right parts of
the text.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"Jo Farnworth" wrote in message
...
Is there a way in Word (as there is in Wordperfect using
Flush commands)to align some words on a line with the
left margin and some words on the same line with the
right margin? In Wordperfect I could set up a document
with a title on the left side and the date aligned on the
right margin but cannot find a way in Word to do this.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A challenging question on text boxes-word 2000 fw76 Page Layout 16 October 18th, 2004 11:45 PM
Too many hyperlinks? [email protected] Powerpoint 7 May 25th, 2004 02:19 AM
Vertical Text Orientation Paul Anderson [MSFT] Visio 0 May 11th, 2004 05:16 PM
Column separator crosses through wrapped text box Bob S Page Layout 0 April 25th, 2004 09:52 PM
Extracting text Nemo Worksheet Functions 3 April 6th, 2004 02:33 PM


All times are GMT +1. The time now is 12:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.