Why is my label maker only showing 2 labels and not entire sheet

  • Thread starter Doug Robbins - Word MVP
  • Start date
D

Doug Robbins - Word MVP

Are we talking about Word here? Are you using a Tablet PC?

If both of these are true, create a template in which you create the
following macro and save it in the Word Startup Folder:

Sub MailMergePropagateLabel()
Dim atable As Table
Dim i As Long
Dim j As Long
Dim source As Cell
Dim target As Cell
Dim myrange As Range

Set atable = ActiveDocument.Tables(1)
Set source = atable.Cell(1, 1)
Set myrange = source.Range
myrange.Collapse wdCollapseStart
ActiveDocument.Fields.Add Range:=myrange, Text:="NEXT", _
PreserveFormatting:=False
source.Range.Copy
For j = 2 To atable.Columns.Count
Set target = atable.Cell(1, j)
If target.Range.Fields.Count > 0 Then
target.Range.Paste
End If
Next j
For i = 2 To atable.Rows.Count
For j = 1 To atable.Columns.Count
Set target = atable.Cell(i, j)
If target.Range.Fields.Count > 0 Then
target.Range.Paste
End If
Next j
Next i
atable.Cell(1, 1).Range.Fields(1).Delete

End Sub



--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top