Thread: [Solved] Mail merge bookmark (again)
View Single Post
 
Old 10-21-2014, 03:34 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, make the following changes to the code.
Replace:
j = -Int(-(TblSrc.Rows.Count - 1) / 3 * 2)
With:
j = (TblSrc.Rows.Count - 2) * 3 + 1

Replace:
.LeftMargin = CentimetersToPoints(0.72)
.RightMargin = CentimetersToPoints(0.72)
With:
.LeftMargin = CentimetersToPoints(0.65)
.RightMargin = CentimetersToPoints(0.65)

After:
.TopMargin = CentimetersToPoints(0.45)
Insert:
Code:
    With .TextColumns
      .SetCount NumColumns:=3
      .EvenlySpaced = True
      .Spacing = 0
      .Width = CentimetersToPoints(6.57)
    End With
Replace:
Set TblTgt = .Tables.Add(Range:=.Range, NumRows:=j, NumColumns:=3, _
With:
Set TblTgt = .Tables.Add(Range:=.Range, NumRows:=j, NumColumns:=1, _

After:
.Borders.Enable = False
Insert:
.Rows.Alignment = wdAlignRowCenter

Replace:
Set Rng = .Cells((i - 1) * 2 - 1).Range
With:
Set Rng = .Cells((i - 2) * 3 + 1).Range

What the above changes do is to give the document itself a 3-column page layout, in which a single-column table is used. The table then uses the column-wrapping to manage the layout.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote