G
Greg
MHK
A better way can always come along, still here are some
options.
Use a right aligned tab stop
Use a two column/single row borderless table with left
justify set in the left hand cell and right set in the
right hand cell
Use the following Flush Right Macro:
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
justified on the left side of the line and the second
address justified on the right side of the line, for each
of the 3 lines of the address, ie. street, city/state, and
phone number. Is there any way to left justify the first
address and right justify the second office address on the
same line?
A better way can always come along, still here are some
options.
Use a right aligned tab stop
Use a two column/single row borderless table with left
justify set in the left hand cell and right set in the
right hand cell
Use the following Flush Right Macro:
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
We have 2 offices. I would like to have one address-----Original Message-----
I am trying to set up a header for my firm's letterhead.
justified on the left side of the line and the second
address justified on the right side of the line, for each
of the 3 lines of the address, ie. street, city/state, and
phone number. Is there any way to left justify the first
address and right justify the second office address on the
same line?