The following macro sets a centre aligned tab, centred between the current margins, and a right aligned tab at the right margin. Sub AddTabs() Dim iLeft As Long Dim iRight As Long Dim iCentre As Long Dim iWidth As Long With Selection iLeft = .Sections(1).PageSetup.LeftMargin iRight = .Sections(1).PageSetup.RightMargin iWidth = .Sections(1).PageSetup.PageWidth iCentre = (iWidth - iLeft - iRight) / 2 .ParagraphFormat.TabStops.Add Position:=iCentre, _ Alignment:=wdAlignTabCenter, _ Leader:=wdTabLeaderSpaces Leader:=wdTabLeaderSpaces.ParagraphFormat.TabStops.Add Position:=iWidth - (iRight + iLeft), _ Alignment:=wdAlignTabRight, _ End With End Sub |
Thursday, September 8, 2011
Add tabs to centre of text area and right margin
Labels:
MACROS
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment